Opened 17 years ago
Closed 17 years ago
#5412 closed (duplicate)
Add actions to models in admin interface
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | admin, save(), action, meta | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It would be a great feature the possibility to add a button with an action near "save", "save and...", and call a method on the model.
If one instance needs some elaboration after save, the only possibility now is to add to the save() function that code. But if that involves ManyToMany fields the game is over, the field is empty in save() and you can do nothing.
with an action I could add the functionality to a new method, and call it wh<enewer I need just opening the admin and findind the needed instance of my model.
It would increase the possibility for the developer.
You could send, for example, an email with the object, reload or recalculate automagically some fields, and so on.
I thing it would be easy to add in the model (just add an attribute like ordering with the name of the method/s to call) and in admin interface (just look in the model like it do for "view in site"
Duplicate of #2409 and #3059, and the latter of those is likely to be made obsolete by newforms-admin.