diff options
Diffstat (limited to 'ishtar/furnitures/forms.py')
| -rw-r--r-- | ishtar/furnitures/forms.py | 34 | 
1 files changed, 10 insertions, 24 deletions
| diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py index cb584ad01..7ae604f9b 100644 --- a/ishtar/furnitures/forms.py +++ b/ishtar/furnitures/forms.py @@ -1822,10 +1822,12 @@ class RecordFormGeneral(forms.Form):                              validators=[validators.MaxLengthValidator(200)])      description = forms.CharField(label=_(u"Description"),                                    widget=forms.Textarea, required=False) -    lenght = forms.IntegerField(label=_(u"Lenght")) -    width = forms.IntegerField(label=_(u"Width")) -    thickness = forms.IntegerField(label=_(u"Thickness")) -    depth = forms.IntegerField(label=_(u"Depth")) +    lenght = forms.IntegerField(label=_(u"Lenght"), required=False) +    width = forms.IntegerField(label=_(u"Width"), required=False) +    thickness = forms.IntegerField(label=_(u"Thickness"), required=False) +    depth = forms.IntegerField(label=_(u"Depth"), required=False) +    unit = forms.ChoiceField(label=_("Unit"), required=False, +                             choices=models.Unit.get_types())      location = forms.CharField(label=_(u"Location"), widget=forms.Textarea,             required=False, validators=[validators.MaxLengthValidator(200)]) @@ -1863,31 +1865,17 @@ class DatingForm(forms.Form):                           'period':models.Period}      period = forms.ChoiceField(label=_("Period"),                                 choices=models.Period.get_types()) -    start_date = forms.IntegerField(label=_(u"Start date")) -    end_date = forms.IntegerField(label=_(u"End date")) -    dating_type = forms.ChoiceField(label=_("Dating type"), +    start_date = forms.IntegerField(label=_(u"Start date"), required=False) +    end_date = forms.IntegerField(label=_(u"End date"), required=False) +    dating_type = forms.ChoiceField(label=_("Dating type"), required=False,                                 choices=models.DatingType.get_types()) -    quality = forms.ChoiceField(label=_("Quality"), +    quality = forms.ChoiceField(label=_("Quality"), required=False,                                 choices=models.DatingQuality.get_types())  DatingFormSet = formset_factory(DatingForm, can_delete=True,                                formset=FormSet)  DatingFormSet.form_label = _("Dating") -class UnitForm(forms.Form): -    form_label = _("Units") -    associated_models = {'unit':models.Unit} -    unit = forms.ChoiceField(label=_("Unit"), -                             choices=models.Unit.get_types()) - -class UnitFormSet(FormSet): -    def clean(self): -        return clean_duplicated(self, ['unit']) - -UnitFormSet = formset_factory(UnitForm, can_delete=True, -                              formset=UnitFormSet) -UnitFormSet.form_label = _("Unit") -  class RecordFormInterpretation(forms.Form):      form_label = _("Interpretation")      has_furniture = forms.NullBooleanField(label=_(u"Has furniture?"), @@ -1907,7 +1895,6 @@ record_creation_wizard = RecordWizard([      ('selec-record_creation', OperationFormSelection),      ('general-record_creation', RecordFormGeneral),      ('datings-record_creation', DatingFormSet), -    ('units-record_creation', UnitFormSet),      ('interpretation-record_creation', RecordFormInterpretation),      ('final-record_creation', FinalForm)],       url_name='record_creation',) @@ -1916,7 +1903,6 @@ record_modification_wizard = RecordModifWizard([      ('selec-record_modification', RecordFormSelection),      ('general-record_modification', RecordFormGeneral),      ('datings-record_modification', DatingFormSet), -    ('units-record_modification', UnitFormSet),      ('interpretation-record_modification', RecordFormInterpretation),      ('final-record_modification', FinalForm)],       url_name='record_modification',) | 
