Opened 4 months ago

Last modified 4 months ago

#35611 closed New feature

Admin action without the need to select objects — at Version 1

Reported by: Patrick Hintermayer Owned by:
Component: contrib.admin Version: 5.0
Severity: Normal Keywords: actions
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Patrick Hintermayer)

I suggest adding a new option to write actions which does not need objects to be selected. For example we want to add an action to reset a reminder flag for all existing objects. But if you haven't selected any objects, it does not work and shows you the message, that no objects were selected.

A possible non-breaking option could be to add a new optional parameter to the @admin.action() decorator to deactivate the previously mentioned behavior.

Alternative with a new field, e. g. "extended_actions":
https://gist.github.com/rafen/eff7adae38903eee76600cff40b8b659

Change History (2)

comment:1 by Patrick Hintermayer, 4 months ago

Description: modified (diff)

by Sarah Boyce, 4 months ago

Attachment: image-20240718-090920.png added
Note: See TracTickets for help on using tickets.
Back to Top