Button with save and custom action in Admin

1,207 views
Skip to first unread message

Rob

unread,
Dec 10, 2012, 3:59:51 AM12/10/12
to django...@googlegroups.com
In Django 1.4 I am working on a small mailing app, and in the admin change page I would like to add a button called "send mailing". When the user presses the button the model should be saved first, en then redirected to a custom page to view and confirm the mailing before send.

I saw lots of snippets, custom actions etc. etc. but I cannot get it working.

I have add a custom change_form.html in /templates/admin/myapp and succesfully added a button. But how do I "tell" Django to do the two actions?

When I add name="_save" to the button the model is saved after pressing the custom button, but now I need a redirect to a custom page using the currect model.

Rob

unread,
Dec 10, 2012, 10:09:15 AM12/10/12
to django...@googlegroups.com
I found a snippet which does everything I want (in case anybody runs into the same problem):
http://djangosnippets.org/snippets/2005/

Reply all
Reply to author
Forward
0 new messages