I would like to add an extra button to the submit row in django.
Standard we get “delete”, “save”, “save and continue editing” and “save and add another”. To this set I would like to add another button which would call a function on the model.
As far as I understand the template change_form is generated in one of the admin.views. The context submit_row is passed as context.
I want to edit the context of the admin view. Where can I find it in my filesystem?
From what I can tell, there are two relevant files. The first is
which has the following section:
And the second is
which is the following:
You can probably just add some custom html to the second file to display new buttons.