Opened 16 years ago
Closed 12 years ago
#10871 closed New feature (wontfix)
Add input support to admin actions (with patch)
Reported by: | Jerome Leclanche | Owned by: | Jerome Leclanche |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | Normal | Keywords: | |
Cc: | kmike84@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
I wanted to be able to set tags to a lot of objects at once in the admin site.
The attached patch adds a takes_input attribute to an admin action (default False). If set to True, a 4th "input" argument will be passed, which you can use as such:
def add_tag(modeladmin, request, queryset, input): for obj in queryset: Tag.objects.add_tag(obj, input) add_tag.takes_input = True
I'd love some comments on it. Some TODO would be:
- Hiding the input if no give action takes an input
- js-disabling it if the current selected action doesn't take an input.. not too sure about that.
Attachments (1)
Change History (13)
by , 16 years ago
Attachment: | admin-action-input.patch added |
---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
It's personally one of the things I'd expect to be able to do without an intermediate page. Per the docs, and intermediate page would be for more complex actions. Adding an input field on-demand, to me, sounds reasonable.
comment:3 by , 15 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:4 by , 15 years ago
Cc: | added |
---|
comment:5 by , 15 years ago
I quote Version1.2Features:
Admin-03 (Support for input arguments on admin actions.) - this would overly complicate the admin UI and dilute the purpose of the admin actions.
Thought this would be relevant to this discussion.
comment:6 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:7 by , 14 years ago
Version: | 1.1-beta-1 |
---|
comment:8 by , 14 years ago
UI/UX: | set |
---|
comment:12 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Comment 5 points out this was rejected in the past. To reverse that decision, please make your case on django-developers.
Would I be right in saying that this can already be done using an action with an intermediate page?
A change like this appears to complicate things, and doesn't cover the field (it only works where the required input is a single line of text).