Possible Duplicate:
Can “list_display” in a Django ModelAdmin display attributes of ForeignKey fields?
I want to show some information on the admin list view of a model which comes from another, related model.
class Identity(models.Model):
blocked = models.BooleanField()
...
class Person(models.Model):
modelARef = OneToOneField("Identity", primary_key=True)
descr = models.CharField(max_length=255)
name = models.CharField(max_length=255)
The User should be able to add/edit "Person" on the admin page. As there ist no support for reverse inlining I have to show "Identity" on the admin page and then inline "Person". "Identity" only contains additional information to "Person" which should be visible on the admin page.
Now when I have a admin page for "Identity" how can I show fields from the "Person"-model on the list_display of "Identity"?
regards
EDIT: I can add some functions to "Identity" which query the related "Person" and return the needed value but if I do that there is no possibility to sort that column.