diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-02-25 15:29:11 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-02-25 15:32:20 +0100 |
commit | 3117dd072d1dc43b6173d7a79fe5850f7e562dd7 (patch) | |
tree | bdd3269380a6b7fe0cda14544b6ce7e34b625ff8 | |
parent | e01ed92134b04f31f069bd7da1d438c19e35b93c (diff) | |
download | Ishtar-3117dd072d1dc43b6173d7a79fe5850f7e562dd7.tar.bz2 Ishtar-3117dd072d1dc43b6173d7a79fe5850f7e562dd7.zip |
Archaeological files forms: simplify a wizard step (refs #1673)
-rw-r--r-- | archaeological_files/forms.py | 22 | ||||
-rw-r--r-- | archaeological_files/views.py | 2 |
2 files changed, 8 insertions, 16 deletions
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, diff --git a/archaeological_files/views.py b/archaeological_files/views.py index 75443aab5..eeae4fa78 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -112,7 +112,6 @@ file_search_wizard = SearchWizard.as_view( url_name='file_search',) file_creation_wizard = FileWizard.as_view([ ('general-file_creation', FileFormGeneral), - ('address-file_creation', FileFormAddress), ('towns-file_creation', TownFormset), ('parcels-file_creation', ParcelFormSet), ('preventive-file_creation', FileFormPreventive), @@ -127,7 +126,6 @@ file_creation_wizard = FileWizard.as_view([ file_modification_wizard = FileModificationWizard.as_view([ ('selec-file_modification', FileFormSelection), ('general-file_modification', FileFormGeneralRO), - ('adress-file_modification', FileFormAddress), ('towns-file_modification', TownFormset), ('parcels-file_modification', ParcelFormSet), ('preventive-file_modification', FileFormPreventive), |