Code

Opened 7 years ago

Closed 7 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:

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"

Attachments (0)

Change History (1)

comment:1 Changed 7 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.