Fixed: parent form field is not required.

This commit is contained in:
Emanuel Schuetze 2011-08-02 21:40:08 +02:00
parent f465f2088c
commit d41a1c4791

View File

@ -20,7 +20,7 @@ class ItemFormText(ModelForm):
error_css_class = 'error' error_css_class = 'error'
required_css_class = 'required' required_css_class = 'required'
items = Item.objects.all().filter(parent=None).order_by('weight') items = Item.objects.all().filter(parent=None).order_by('weight')
parent = ModelChoiceField(queryset=items, label=_("Parent item")) parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)
class Meta: class Meta:
model = ItemText model = ItemText
exclude = ('closed') exclude = ('closed')
@ -30,7 +30,7 @@ class ItemFormApplication(ModelForm):
error_css_class = 'error' error_css_class = 'error'
required_css_class = 'required' required_css_class = 'required'
items = Item.objects.all().filter(parent=None).order_by('weight') items = Item.objects.all().filter(parent=None).order_by('weight')
parent = ModelChoiceField(queryset=items, label=_("Parent item")) parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)
class Meta: class Meta:
model = ItemApplication model = ItemApplication
@ -41,7 +41,7 @@ class ItemFormPoll(ModelForm):
error_css_class = 'error' error_css_class = 'error'
required_css_class = 'required' required_css_class = 'required'
items = Item.objects.all().filter(parent=None).order_by('weight') items = Item.objects.all().filter(parent=None).order_by('weight')
parent = ModelChoiceField(queryset=items, label=_("Parent item")) parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)
class Meta: class Meta:
model = ItemPoll model = ItemPoll
@ -52,7 +52,7 @@ class ItemFormAssignment(ModelForm):
error_css_class = 'error' error_css_class = 'error'
required_css_class = 'required' required_css_class = 'required'
items = Item.objects.all().filter(parent=None).order_by('weight') items = Item.objects.all().filter(parent=None).order_by('weight')
parent = ModelChoiceField(queryset=items, label=_("Parent item")) parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)
class Meta: class Meta:
model = ItemAssignment model = ItemAssignment