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)
I would like to edit the Book on the Author change page.
I tried with InlineModelAdmin , but since the Book has many fields, it is not easy to edit.
That is why I tried to establish links to children on the author / change template.
<ul> <li><a href="{% url admin:content_scribpart_add %}">Add a Book</a></li> {% for book in original.book_set.all %} <li><a href="{% url admin:myapp_book_change book.id %}">Edit {{ book }}</a></li> {% endfor %} </ul>
But there are a few questions
- How can I pre-create the associated
Author identifier in the Book form - How to make the "Save" button return to the associated
Author - Am I on the right track?
source share