I have a Person
model that has a foreign key relationship to Book
, which has a number of fields, but I'm most concerned about author
(a standard CharField).
With that being said, in my PersonAdmin
model, I'd like to display book.author
using list_display
:
class PersonAdmin(admin.ModelAdmin):
list_display = ['book.author',]
I've tried all of the obvious methods for doing so, but nothing seems to work.
Any suggestions?
Best Answer
As another option, you can do look ups like:
Since Django 3.2 you can use
display()
decorator: