[Django] #35611: Admin action without the need to select objects

1 view
Skip to first unread message

Django

unread,
11:06 AM (8 hours ago) 11:06 AM
to django-...@googlegroups.com
#35611: Admin action without the need to select objects
-------------------------------------+-------------------------------------
Reporter: Patrick Hintermayer | Type: New
| feature
Status: new | Component:
| contrib.admin
Version: 5.0 | Severity: Normal
Keywords: actions | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/35611>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
11:10 AM (8 hours ago) 11:10 AM
to django-...@googlegroups.com
#35611: Admin action without the need to select objects
-------------------------------------+-------------------------------------
Reporter: Patrick Hintermayer | Owner: (none)
Type: New feature | Status: new
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: actions | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Patrick Hintermayer:

Old description:

> 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.

New description:

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

--
--
Ticket URL: <https://code.djangoproject.com/ticket/35611#comment:1>
Reply all
Reply to author
Forward
0 new messages