Opened 8 years ago

Closed 8 years ago

#5412 closed (duplicate)

Add actions to models in admin interface

Reported by: alessandro.ronchi@… Owned by: nobody
Component: contrib.admin Version: master
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: UI/UX:


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"

Change History (1)

comment:1 Changed 8 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #2409 and #3059, and the latter of those is likely to be made obsolete by newforms-admin.

Note: See TracTickets for help on using tickets.
Back to Top