Re: custom dynamic admin actions

2009-09-28 Thread J

Joshua Russo wrote:
> It sounds like you just want defaults for your relationships. Is that
> right? How are you determining which account to use?
>

No. I want admin actions at the top of my list similar to "Delete
selected ..." so that I can select a bunch of records and set the
foreign key for them all.


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



Re: custom dynamic admin actions

2009-09-28 Thread Joshua Russo
It sounds like you just want defaults for your relationships. Is that right?
How are you determining which account to use?

On Mon, Sep 28, 2009 at 12:30 PM, J  wrote:

>
> Joshua Russo wrote:
> > When do you want your "dynamic actions" take place?
> >
>
> I apoligize if I was unclear. I am referring to the admin actions that
> one can select from a select box at the top of lists in admin pages.
> It's described at
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/
>
> There is no difficulty in adding static custom actions (as described at
> the link above), such as the default "Delete selected /item/s", but what
> I am trying to do is add actions that are based on a db relationship,
> such as "Set to account #1", which would set the local foreign key field
> to "account #1", which is a one of several records in the related model,
> and I would like one action for each of the records in the related model.
>
> Thanks.
>
>
> >
>

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



Re: custom dynamic admin actions

2009-09-28 Thread J

Joshua Russo wrote:
> When do you want your "dynamic actions" take place?
>  

I apoligize if I was unclear. I am referring to the admin actions that
one can select from a select box at the top of lists in admin pages.
It's described at
http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/

There is no difficulty in adding static custom actions (as described at
the link above), such as the default "Delete selected /item/s", but what
I am trying to do is add actions that are based on a db relationship,
such as "Set to account #1", which would set the local foreign key field
to "account #1", which is a one of several records in the related model,
and I would like one action for each of the records in the related model.

Thanks.


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



Re: custom dynamic admin actions

2009-09-28 Thread Joshua Russo
On Mon, Sep 28, 2009 at 4:30 AM, J <jobce...@gmail.com> wrote:

>
> Hello,
>
> I need to add custom dynamic admin actions (based on records in a
> related table), but I'm not entirely sure how to do this, as it's not
> explained in the docs.
>
> Basically, I have two models: "Transaction", which has a foreign key to
> "Account", and I want to define an admin action that will set all the
> selected records in the "Transaction" model to a specific "Account".
>
> One idea I had was to have different actions: "Set to account 1", "Set
> to account 2", but I'm having trouble creating these admin actions
> dynamically.


When do you want your "dynamic actions" take place?

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



custom dynamic admin actions

2009-09-27 Thread J

Hello,

I need to add custom dynamic admin actions (based on records in a
related table), but I'm not entirely sure how to do this, as it's not
explained in the docs.

Basically, I have two models: "Transaction", which has a foreign key to
"Account", and I want to define an admin action that will set all the
selected records in the "Transaction" model to a specific "Account".

One idea I had was to have different actions: "Set to account 1", "Set
to account 2", but I'm having trouble creating these admin actions
dynamically.

Thanks for your assistance,
J


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