I have two classes in models.py:
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
And your administration in admin.py is this:
class ModelTwoInline(admin.StackedInline): model = ModelTwo extra = 0 class ModelOneAdmin(admin.ModelAdmin): list_display = ('field_one', 'field_two', 'field_three',) inlines = [ModelTwoInline]
My question is: Can I 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!