As a new feature in Django 1.8, we have InlineModelAdmin.show_change_link
, which, in the words of the documentation,
Specifies whether or not inline objects that can be changed in the admin have a link to the change form.
This is great, and I've been looking for this feature to be added for a long time.
Just one problem.
Say I'm on the admin change form for an instance of some model that has inlines (e.g., consider the Poll
model, with Choice
inlines, from the Django tutorial). I use the new "Change" link to go to the full change form for one of the Choice
s. I make some edits and click "Save".
I would expect to be taken back where I came from — that is, to the change form for the Poll
instance. Instead, I am taken to the list of all Choice
instances.
How can I have Django remember that if I came from a list of inlines, I should go back there on "Save"? (But if I ever do edit the Choice
directly from the list of all Choice
s, I should go back there.)