ModelChoiceField with Unique Results

2008-09-22 Thread BobZ
What I'm trying to do seems relatively simple, but I have yet to find a proper solution for it. I'm trying to query a list of years from a database of registered vehicles in my county and display them in a drop-down select menu in a form. Since the registered vehicles database has many cars of

Re: ModelChoiceField with Unique Results

2008-09-22 Thread BobZ
ear = forms.ChoiceField() > >     def __init__(self, *args, **kwargs): >         super(SearchForm, self) .__init__(*args, **kwargs) > >         self.fields['year'].choices = \ >             set([(obj.year, obj.year) for obj in \ >             Vehicle.objects.all().order

Re: ModelChoiceField with Unique Results

2008-09-23 Thread BobZ
;models.py - http://dpaste.com/80010/ http://dpaste.com/80009/";>forms.py - http://dpaste.com/80009/ http://dpaste.com/80011/";>views.py - http://dpaste.com/80011/ http://dpaste.com/80013/";>search.html - http://dpaste.com/80013/ On Sep 23, 1:32 am, Daniel Roseman <[E

Re: ModelChoiceField with Unique Results

2008-09-23 Thread BobZ
I had SOME luck with "queryset=Vehicle.objects.filter(year=True)" in that the form actually rendered in my template, but the year select box is empty now. All other select boxes load fine (Make and Model) with their data...only year still won't work. On Sep 23, 10:44 am, BobZ &l

Re: ModelChoiceField with Unique Results

2008-09-24 Thread BobZ
Sep 23, 4:37 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Sep 23, 4:44 pm, BobZ <[EMAIL PROTECTED]> wrote: > > > > > Thanks Daniel.  I've found solutions similar to yours in other threads > > on the net, and everytime I test them, I literally get

Re: how to use form_class with generic views?

2009-08-24 Thread BobZ
I'm having a similar problem actually. I'm trying to extend Photologue to offer front-end user upload capability with generic views and I haven't been able to successfully render a page yet. Each of the commented-out "upload_args" are variations I've tried to get something back and none of them h

Re: how to use form_class with generic views?

2009-08-24 Thread BobZ
).__init__(*args, **kwargs) class Meta: model = Photo exclude = ( 'user', 'title_slug', 'view_count', 'date_added', ) On Aug 24, 10:57 am, Daniel Roseman wrote: > On Aug 24, 4:26 pm, BobZ wrote: > > > > > I'm ha

Re: how to use form_class with generic views?

2009-08-24 Thread BobZ
The real brain buster is that I get this error whether I'm passing a form_class or a simple Model in urls.py On Aug 24, 11:05 am, BobZ wrote: > Thanks for the quick response! > > forms.py > > from django import forms > from django.forms import ModelForm > from mod

Re: how to use form_class with generic views?

2009-08-25 Thread BobZ
5:06 pm, BobZ wrote: > > > > > The real brain buster is that I get this error whether I'm passing a > > form_class or a simple Model in urls.py > > > On Aug 24, 11:05 am, BobZ wrote: > > > > Thanks for the quick response! > > > > forms