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.ChoiceField(choices=sl_list, required=True) # rest of fields... The initial keyword when creating an instance of the form is used to select which of the choices is rendered as selected. Haven't tested this though. - Sævar On Dec 9, 11:18 pm, Sector7B <joe.greenaw...@gmail.com> wrote: > 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.ChoiceField(choices=constants.minutes,required=True) > time_close_hours = > forms.ChoiceField(choices=constants.hours,required=True) > time_close_minutes = > forms.ChoiceField(choices=constants.minutes,required=True) > > there can be many locations, so in my view i loop through them to > create a list of tuples to provide a choices list for location: > Log Output of the list when im done:sl_list= [('-', 'Choose > Location'), (u'Super City', u'901 PHILADELPHIA STREET')] > > the code i use to set initial is the following: > > form = StoreLocationHoursForm(initial={"location":sl_list}) > > However my select is empty when it renders the HTML. > > Thanks for the help in advance, > > 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-us...@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.