Re: forms.ChoiceField and empty values

2009-11-13 Thread Monika Sulik
Sorry for the double post *blush* Not sure how that happened... The model looks something like this: class Competition(MessageboardOwner): name = models.CharField(max_length=256) type = models.IntegerField(choices=COMPETITION_TYPE_CHOICES) start = models.DateField() end =

Re: forms.ChoiceField and empty values

2009-11-12 Thread rebus_
2009/11/12 Monika Sulik : > As I haven't had any replies so far, I'll add some more information... > > The empty label appears if I redefine the form like this: > > class CompetitionSearchForm(forms.ModelForm): >    class Meta: >        model = Competition >        fields =

Re: forms.ChoiceField and empty values

2009-11-12 Thread Monika Sulik
As I haven't had any replies so far, I'll add some more information... The empty label appears if I redefine the form like this: class CompetitionSearchForm(forms.ModelForm): class Meta: model = Competition fields = ('name','type') It disappears again if I make the changes I

Re: forms.ChoiceField and empty values

2009-11-12 Thread Monika Sulik
As I haven't had any replies so far, I'll add some more information... The empty label appears if I redefine the form like this: class CompetitionSearchForm(forms.ModelForm): class Meta: model = Competition fields = ('name','type') It disappears again if I make the changes I

forms.ChoiceField and empty values

2009-11-10 Thread Monika Sulik
Hi, I have the following problem... I've got a form, which looks like this: class CompetitionSearchForm(forms.Form): name = forms.CharField(required=False) type = forms.ChoiceField(choices=COMPETITION_TYPE_CHOICES, required=False) The tuple COMPETITION_TYPE_CHOICES is used in a model