From 3117dd072d1dc43b6173d7a79fe5850f7e562dd7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 25 Feb 2014 15:29:11 +0100 Subject: Archaeological files forms: simplify a wizard step (refs #1673) --- archaeological_files/forms.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'archaeological_files/forms.py') diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index 18e7bcc82..87f86d0d0 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -137,6 +137,14 @@ class FileFormGeneral(forms.Form): validators=[valid_id(models.File)]) comment = forms.CharField(label=_(u"Comment"), widget=forms.Textarea, required=False) + total_surface = forms.IntegerField(required=False, + widget=widgets.AreaWidget, + label=_(u"Total surface (m²)"), + validators=[validators.MinValueValidator(0), + validators.MaxValueValidator(999999999)]) + address = forms.CharField(label=_(u"Main address"), widget=forms.Textarea) + address_complement = forms.CharField(label=_(u"Main address - complement"), + required=False) def __init__(self, *args, **kwargs): super(FileFormGeneral, self).__init__(*args, **kwargs) @@ -156,20 +164,6 @@ class FileFormGeneralRO(FileFormGeneral): numeric_reference = forms.IntegerField(label=_(u"Numeric reference"), widget=forms.TextInput(attrs={'readonly':True})) -class FileFormAddress(forms.Form): - form_label = _(u"Address") - associated_models = {'town':Town} - total_surface = forms.IntegerField(required=False, - widget=widgets.AreaWidget, - label=_(u"Total surface (m²)"), - validators=[validators.MinValueValidator(0), - validators.MaxValueValidator(999999999)]) - address = forms.CharField(label=_(u"Main address"), widget=forms.Textarea) - address_complement = forms.CharField(label=_(u"Main address - complement"), - required=False) - postal_code = forms.CharField(label=_(u"Main address - postal code"), - max_length=10) - class FileFormPreventive(forms.Form): form_label = _(u"Preventive informations") associated_models = {'general_contractor':Person, -- cgit v1.2.3