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)
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
2 matches
Mail list logo