#10871: Add input support to admin actions (with patch)
----------------------------------+-----------------------------------------
Reporter: Adys | Owner: Adys
Status: new | Milestone:
Component: django.contrib.admin | Version: 1.1-beta-1
Keywords: | Stage: Unreviewed
Has_patch: 1 |
----------------------------------+-----------------------------------------
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.
--
Ticket URL: <http://code.djangoproject.com/ticket/10871>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---