On Tue, Apr 7, 2009 at 8:04 PM, Malcolm Tredinnick <malc...@pointy-stick.com
> wrote:

>
> On Tue, 2009-04-07 at 06:55 -0700, pault wrote:
> > I want to run an action from my admin when I press the GO button
> > without having to select any objects.
> >
> > But it seems actions are only triggered when at least one object is
> > selected. Does anyone know a workaround for this.
>
> What you're after are not admin actions then, since admin actions are
> things that apply to multiple objects at once (they're basically batch
> operations).
>
> However, the templates used in the admin are all customisable and
> overridable, usually on a per-app and even per-model basis. So you can
> easily add your own extra button(s) that perform some action. Adding
> your own URL handling to the admin is also documented. Best to use the
> upcoming 1.1 release (e.g. 1.1-beta now) for that, since it's all much
> easier.
>
> Regards,
> Malcolm
>
>
>
> >
>
When this feature was implemented it was discussed whether the actions
should be called if no items were selected.  The conclusion was no, since
it's not very intuitive for the same UI element to control 2 types of
actions(those that happen to regardless of whats selected and those that are
applied to selected objects).  What you really want is an extra link the
object-tools part of the page.
http://docs.djangoproject.com/en/dev/obsolete/admin-css/?from=olddocs#object-toolsexplains
how to get them there(the part of the page that warns this is no
longer applicable, isn't applicable for this).

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to