Re: Overriding widget for forms.ModelMultipleChoiceField in ModelForm

2010-02-22 Thread rennat
Here is how I accomplished this with a ModelForm class VariationForm(forms.ModelForm): option_values = forms.ModelMultipleChoiceField(queryset=Value.objects.none(), widget=CheckboxSelectMultiple(), required=False) class Meta: model = Variation def __init__(self, *args

Overriding widget for forms.ModelMultipleChoiceField in ModelForm

2010-02-21 Thread Zodiak
Does anybody know how to make this? This variant: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-default-field-types-or-widgets DOES NOT WORK for forms.ModelMultipleChoiceField -- You received this message because you are subscribed to the Google Groups "D

Re: forms.ModelMultipleChoiceField

2008-12-02 Thread Daniel Roseman
BooleanField(required=False) >     country = forms.ModelMultipleChoiceField(queryset=Country.objects.all()) > > and the template with: > > > > > I've a problem to set the field 'country': > >       > thanks, > > Alfredo If you're using Django's form facilitie

forms.ModelMultipleChoiceField

2008-12-02 Thread Alfredo Alessandrini
Hi, I've set the player form with: class PlayerForm(forms.Form): challengeable = forms.BooleanField(required=False) show_name = forms.BooleanField(required=False) country = forms.ModelMultipleChoiceField(queryset=Country.objects.all()) and the template with: I've a