Re: Django Form ChoiceField, initial not working

2010-12-11 Thread wayne
On Dec 11, 5:08 am, Sævar Öfjörð wrote: > I think you should provide your choices in the form field, not when > creating an instance of the form. Agreed. To create a dynamic form such as this, the best way would probably be to use a custom __init__ function. In your view, when you create your

Re: Django Form ChoiceField, initial not working

2010-12-11 Thread Sævar Öfjörð
I think you should provide your choices in the form field, not when creating an instance of the form. The form would then be something like this: class StoreLocationHoursForm(BForm): sl_list= [('-', 'Choose Location'), (u'Super City', u'901 PHILADELPHIA STREET')] location = forms.ChoiceFie

Django Form ChoiceField, initial not working

2010-12-09 Thread Sector7B
Hi, i have a simple form: class StoreLocationHoursForm(BForm): location = forms.ChoiceField(required=True) day = forms.ChoiceField(choices=bagit_constants.dow,required=True) time_open_hours = forms.ChoiceField(choices=constants.hours,required=True) time_open_minutes = forms.ChoiceFi