Re: newforms: overriding default widget, providing choices, and validation

2007-01-18 Thread HÃ¥kan Johansson
You need to send your choices to both the widget and the form. the_choices = [(c.id,c.description) for c in CustomerType.objects.all()] customer_type = forms.MultipleChoiceField( required=False, widget=forms.SelectMultiple(attrs={'size':'3'}, choices=the_choices) choices=the_choices)

newforms: overriding default widget, providing choices, and validation

2007-01-14 Thread gordyt
Howdy Gang, I noticed something interesting with newforms and I'm wondering if I'm doing the right thing or not. Let's say I have the following in one of my forms: customer_type = forms.MultipleChoiceField( required=False, choices=[(c.id,c.description) for c in