Hi everybody!

I have two classes in models.py:

<pre>class ModelOne(models.Model):
   field_one = models.CharField(max_length=100)
   field_two = models.CharField(max_length=200)
   field_three = models.CharField(max_length=300)
   [...] #other fields
   def __unicode__(self):
       return self.field_one

class ModelTwo(models.Model):
   relation_model_one = models.ForeignKey(ModelOne)
   other_field = models.CharField(max_length=50)
   [...]
   def __unicode__(self):
       return self.relation_model_one.field_one
</pre>

And your administration in admin.py is this:

<pre>
class ModelTwoInline(admin.StackedInline):
    model = ModelTwo
    extra = 0

class ModelOneAdmin(admin.ModelAdmin):
    list_display = ('field_one', 'field_two', 'field_three',)
    inlines = [ModelTwoInline]
</pre>

My question is:
I can display the fields of the ModelTwo in list_display of the
ModelOne? (The same for list_filter and search_fields)

I need this because I have many subclasses related to the main class!

Thanks for help!

*And sorry for english!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to