Re: Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread RajeshD
> > # run with this form following the examples in the newforms > documentations. You can also change the domain "choices" after the form class is created for you by modifying the form class's base_fields as I see you have done in your post in another thread here: http://groups.google.com/group/

Re: Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread RajeshD
On Nov 2, 4:02 pm, rm <[EMAIL PROTECTED]> wrote: > On Nov 2, 3:54 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > > When you acquire a Customer newform instance in your view, you will be > > able to modify the choices attribute of its domain field so that these > > choices only contain the relevant d

Re: Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread rm
On Nov 2, 3:54 pm, RajeshD <[EMAIL PROTECTED]> wrote: > When you acquire a Customer newform instance in your view, you will be > able to modify the choices attribute of its domain field so that these > choices only contain the relevant domains that you mentioned you can > trivially derive knowin

Re: Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread RajeshD
> > I'm after a way of limiting what choices are populated into a drop-down > box from a foreign key field when I'm using the generic create/update views: I would recommend not using the generic create/update views as those views use old forms and manipulators which are going away in favor of "n

Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread Darryl Ross
Hey All, I'm after a way of limiting what choices are populated into a drop-down box from a foreign key field when I'm using the generic create/update views: What I am trying to achieve is to be able to limit the list of domains that a reseller can apply to their customer objects to domains that

Re: Limiting foreign key choices

2007-10-27 Thread myahya
Thank you for the quick reply. Wouldn't something like this be possible using 'limit_choices_to' argument in the ForeignKey definition? On Oct 27, 2:44 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-10-26 at 19:01 +, myahya wrote: > > I have two models: products and catregor

Re: Limiting foreign key choices

2007-10-26 Thread Malcolm Tredinnick
On Fri, 2007-10-26 at 19:01 +, myahya wrote: > I have two models: products and catregories. A product can belong to > exactly one category. To make navigation easier, I use nested > categories. I want to limit the admin's ability to add a product only > to the leaf categories (those with no ch

Limiting foreign key choices

2007-10-26 Thread myahya
I have two models: products and catregories. A product can belong to exactly one category. To make navigation easier, I use nested categories. I want to limit the admin's ability to add a product only to the leaf categories (those with no children). So if I the following structure Electronics > Mo

Re: limiting foreign key choices in a selection field

2006-03-02 Thread Nebojša Đorđević
sam wrote: > Nesh: > > Your method works. Thanks very much! > > Now a tougher situation: > > I want to have the same form to enter "part" information, except the > maker field I want to split into two fields: "category" and "maker". I > want to show different selections in the "maker" field bas

Re: limiting foreign key choices in a selection field

2006-03-01 Thread sam
Nesh: Your method works. Thanks very much! Now a tougher situation: I want to have the same form to enter "part" information, except the maker field I want to split into two fields: "category" and "maker". I want to show different selections in the "maker" field based on what was selected in th

Re: limiting foreign key choices in a selection field

2006-02-28 Thread Nebojša Đorđević
sam wrote: > My problem is the "category" is determined at run-time, not at module > definition time. How to do that? Thanks. I'm missed 'When I make a form to enter the "part" information' part :) From: http://www.djangoproject.com/documentation/forms/ something like this (untested): class Co

Re: limiting foreign key choices in a selection field

2006-02-28 Thread sam
My problem is the "category" is determined at run-time, not at module definition time. How to do that? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: limiting foreign key choices in a selection field

2006-02-28 Thread Nebojša Đorđević
sam wrote: > I have a model such as: > > class Part: > maker = ForeignKey(Maker) > .. > > When I make a form to enter the "part" information, if I user standard > AddManipulator, maker will become a selection list of all possible > makers. What if I only want to show a sub-list of ma

limiting foreign key choices in a selection field

2006-02-28 Thread sam
I have a model such as: class Part: maker = ForeignKey(Maker) .. When I make a form to enter the "part" information, if I user standard AddManipulator, maker will become a selection list of all possible makers. What if I only want to show a sub-list of makers that belong to a specifi