diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-02 10:10:59 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-02 10:10:59 +0200 |
commit | 151e42654a4bcfcff408c7799db199c71e81b5c5 (patch) | |
tree | 02786db1039902c7cc75f76aa7159829299970ac /archaeological_files_pdl | |
parent | 661218e0acd24fc3bca76229b61d0cb91a54be1c (diff) | |
parent | 5eb8667794636e379a8c324da46c617ad365747a (diff) | |
download | Ishtar-151e42654a4bcfcff408c7799db199c71e81b5c5.tar.bz2 Ishtar-151e42654a4bcfcff408c7799db199c71e81b5c5.zip |
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_files_pdl')
-rw-r--r-- | archaeological_files_pdl/forms.py | 18 | ||||
-rw-r--r-- | archaeological_files_pdl/locale/django.pot | 48 |
2 files changed, 34 insertions, 32 deletions
diff --git a/archaeological_files_pdl/forms.py b/archaeological_files_pdl/forms.py index a182d0f0e..99dc97137 100644 --- a/archaeological_files_pdl/forms.py +++ b/archaeological_files_pdl/forms.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2014-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2014-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -27,7 +27,7 @@ from django.utils.translation import ugettext_lazy as _ from ishtar_common.models import Person, Town, Department, valid_id from archaeological_files import models -from ishtar_common.forms import get_now, reverse_lazy +from ishtar_common.forms import get_now, reverse_lazy, ManageOldType from archaeological_files.forms import GENERAL_CONTRACTOR, \ GENERAL_CONTRACTOR_ORGA, RESPONSIBLE_PLANNING_SERVICE, \ RESPONSIBLE_PLANNING_SERVICE_ORGA @@ -37,7 +37,7 @@ from archaeological_operations.forms import SRA_AGENT from ishtar_common import widgets -class FileFormGeneral(forms.Form): +class FileFormGeneral(ManageOldType, forms.Form): form_label = _("General") associated_models = {'file_type': models.FileType} file_type = forms.ChoiceField(label=_("File type"), choices=[]) @@ -52,7 +52,8 @@ class FileFormGeneral(forms.Form): def __init__(self, *args, **kwargs): super(FileFormGeneral, self).__init__(*args, **kwargs) - self.fields['file_type'].choices = models.FileType.get_types() + self.fields['file_type'].choices = models.FileType.get_types( + initial=self.init_data.get('file_type')) self.fields['file_type'].help_text = models.FileType.get_help() def clean_reception_date(self): @@ -63,7 +64,7 @@ class FileFormGeneral(forms.Form): return value -class FileFormPreventiveType(forms.Form): +class FileFormPreventiveType(ManageOldType, forms.Form): form_label = u"Saisine" associated_models = {'saisine_type': models.SaisineType, 'permit_type': models.PermitType} @@ -74,10 +75,11 @@ class FileFormPreventiveType(forms.Form): def __init__(self, *args, **kwargs): super(FileFormPreventiveType, self).__init__(*args, **kwargs) - self.fields['saisine_type'].choices = models.SaisineType.get_types() + self.fields['saisine_type'].choices = models.SaisineType.get_types( + initial=self.init_data.get('saisine_type')) self.fields['saisine_type'].help_text = models.SaisineType.get_help() - self.fields['permit_type'].choices = \ - models.PermitType.get_types(default='NP') + self.fields['permit_type'].choices = models.PermitType.get_types( + default='NP', initial=self.init_data.get('permit_type')) self.fields['permit_type'].help_text = models.PermitType.get_help() diff --git a/archaeological_files_pdl/locale/django.pot b/archaeological_files_pdl/locale/django.pot index a4f73fea5..5c3d03a37 100644 --- a/archaeological_files_pdl/locale/django.pot +++ b/archaeological_files_pdl/locale/django.pot @@ -15,7 +15,7 @@ msgstr "" msgid "File type" msgstr "" -#: forms.py:44 forms.py:401 +#: forms.py:44 forms.py:403 msgid "Year" msgstr "" @@ -27,97 +27,97 @@ msgstr "" msgid "Reception date" msgstr "" -#: forms.py:62 +#: forms.py:63 msgid "Reception date cannot be after today." msgstr "" -#: forms.py:70 +#: forms.py:71 msgid "Permit type" msgstr "" -#: forms.py:72 +#: forms.py:73 msgid "Saisine type" msgstr "" -#: forms.py:85 +#: forms.py:87 msgid "Planning" msgstr "" -#: forms.py:88 +#: forms.py:90 msgid "Planning name" msgstr "" -#: forms.py:91 forms.py:121 +#: forms.py:93 forms.py:123 #: templates/ishtar/wizard/wizard_preventiveplanning.html:31 msgid "Towns" msgstr "" -#: forms.py:93 forms.py:123 +#: forms.py:95 forms.py:125 #: templates/ishtar/wizard/wizard_preventiveplanning.html:41 msgid "Departments" msgstr "" -#: forms.py:94 forms.py:124 +#: forms.py:96 forms.py:126 msgid "Locality" msgstr "" -#: forms.py:97 forms.py:127 +#: forms.py:99 forms.py:129 msgid "Address (number/street)" msgstr "" -#: forms.py:98 forms.py:128 +#: forms.py:100 forms.py:130 msgid "Number/street" msgstr "" -#: forms.py:100 forms.py:130 +#: forms.py:102 forms.py:132 msgid "Postal code" msgstr "" -#: forms.py:105 +#: forms.py:107 msgid "Total surface (m2)" msgstr "" -#: forms.py:110 +#: forms.py:112 msgid "Total developed surface (m2)" msgstr "" -#: forms.py:117 +#: forms.py:119 msgid "Address" msgstr "" -#: forms.py:231 forms.py:235 forms.py:265 forms.py:268 +#: forms.py:233 forms.py:237 forms.py:267 forms.py:270 msgid "General contractor" msgstr "" -#: forms.py:250 forms.py:362 +#: forms.py:252 forms.py:364 msgid "In charge" msgstr "" -#: forms.py:340 +#: forms.py:342 msgid "Town planning service" msgstr "" -#: forms.py:344 +#: forms.py:346 msgid "File reference" msgstr "" -#: forms.py:347 +#: forms.py:349 msgid "Planning service" msgstr "" -#: forms.py:381 +#: forms.py:383 msgid "Person in charge" msgstr "" -#: forms.py:393 +#: forms.py:395 msgid "Related file" msgstr "" -#: forms.py:397 +#: forms.py:399 msgid "Comment" msgstr "" -#: forms.py:404 +#: forms.py:406 msgid "Numeric reference" msgstr "" |