Lets take the standard example
class Author(models.Model):
name = models.CharField(max_length=100)
class Book(models.Model):
title = models.CharField(max_length=100)
author = models.ForeignKey(Author)
#... Many other fields ...
On the admin interface from the Author change page, I’d like to be able to add/edit his Books.
There you are going to tell me please RTFM and use a InlineModelAdmin.
But wait, as you can see there are “Many other fields” in Books and it will not be easily editable.
What I imagined is to be able to simply display the book titles in the Author change page, and supply links to add or edit his books. How can I do that ?
You can override the
change_viewand/or edit the change_form template.There’s a section in the docs you can consult on this topic: Overriding vs. replacing an admin template
Some more specific information can be found here: Display link to full change form for object in django admin