Delta20
unread,Oct 15, 2008, 5:08:17 PM10/15/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django developers
What's the cleanest way to customize the submit buttons that appear on
an admin change_form? If there's a way to override submit_row on
change_form, that would be the simplest approach, I think, but I'm
very much a django beginner so I would appreciate some guidance.
To provide some context, here's what I'm trying to achieve in doing
this:
The model FieldReport represents some raw data that, if an
administrator deems it useful, they use it as the basis of creating an
"Article". The desired functionality is:
a) When a FieldReport is viewed in admin, there are two submit buttons
"Accept" and "Reject"
b) If the "Accept" button is clicked, go to the Article admin/edit
form to create a new Article, with the various FieldReport fields
copied into the relevant Article fields.
The obvious way to do this seems to be to create a custom admin
change_form template with the two submit buttons then create a view
function for each of these buttons, with accept just displaying the
standard change_form for the new Article, but I'm wondering if there's
a better approach.