display one-to-many relationship for a model in Django admin (list mode)

Posted by theactiveactor on Stack Overflow See other posts from Stack Overflow or by theactiveactor
Published on 2010-05-29T03:44:24Z Indexed on 2010/05/29 3:52 UTC
Read the original article Hit count: 289

Filed under:
|

In Django admin site, when listing all the objects for a given model, I know we can customize which columns get displayed for a ModelA via list_display

Say that ModelA has a one-to-many relationship with ModelB. I would like to add another column on the listing page for ModelA, where each entry is a URL pointing to all objects of ModelB having a foreign key relationship on corresponding instance of Model A in that row. How can I achieve this customization with the admin app?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-admin