Re: ModelChoiceField queryset option

2009-06-11 Thread Bobby Roberts
> Hi. > You should take a read on the queryset api, that would help you a lot > In the furture. For distinct values add .distinct() so you fx get > ...filter(...).distinct() > > ~Jakob Jakob - I've read the docs and know about distinct. The issue here is that a modelchoicefield returns the ID

Re: ModelChoiceField queryset option

2009-06-11 Thread googletorp
Hi. You should take a read on the queryset api, that would help you a lot In the furture. For distinct values add .distinct() so you fx get ...filter(...).distinct() ~Jakob On Jun 11, 7:28 pm, Bobby Roberts wrote: > > The issue is the line:

Re: ModelChoiceField queryset option

2009-06-11 Thread Bobby Roberts
> The issue is the line: WebPage.objects.filter(page_plaque!='').  The > queryset syntax doens't use the != operator anywhere.  To do != operations > you need to instead do WebPage.objects.exclude(page_plaque=''). > ok that got past the error but there are dupes in there. Is there a way to pull

Re: ModelChoiceField queryset option

2009-06-11 Thread Alex Gaynor
On Thu, Jun 11, 2009 at 12:13 PM, Bobby Roberts wrote: > > hi group > > i'm trying to create a drop box that is populated with a distinct list > of values from a certain field (fieldname=page_plaque) in the table. > Here is what i have in my forms.py > > > class

ModelChoiceField queryset option

2009-06-11 Thread Bobby Roberts
hi group i'm trying to create a drop box that is populated with a distinct list of values from a certain field (fieldname=page_plaque) in the table. Here is what i have in my forms.py class PagePlaqueModelChoiceField (forms.ModelChoiceField): def label_from_instance(self,obj):