Add actions to models in admin interface
|Reported by:||alessandro.ronchi@…||Owned by:||nobody|
|Severity:||Keywords:||admin, save(), action, meta|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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"