diff options
author | Valérie-Emma Leroux <valerie-emma.leroux@iggdrasil.net> | 2017-04-07 11:40:31 +0200 |
---|---|---|
committer | Valérie-Emma Leroux <valerie-emma.leroux@iggdrasil.net> | 2017-04-07 11:40:31 +0200 |
commit | 655236dd5d04d6527184a58ef8622e75c73f8a65 (patch) | |
tree | f773b80964981c231c892ee5255b94285bc5620a /archaeological_context_records/forms.py | |
parent | dc08e5f643562a6ecf3b208c1e2cd44e5350af3c (diff) | |
parent | a4f1766d2217b1a3bc4d1d17625d9d808eed7416 (diff) | |
download | Ishtar-655236dd5d04d6527184a58ef8622e75c73f8a65.tar.bz2 Ishtar-655236dd5d04d6527184a58ef8622e75c73f8a65.zip |
Merge branch 'master' of git.iggdrasil.net:/srv/git/ishtar
Conflicts:
archaeological_operations/templates/ishtar/sheet_operation.html
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r-- | archaeological_context_records/forms.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index ef17e561e..522c69deb 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -130,8 +130,11 @@ class RecordFormSelection(forms.Form): class RecordFormGeneral(ManageOldType, forms.Form): form_label = _("General") file_upload = True - associated_models = {'parcel': Parcel, 'unit': models.Unit, - 'excavation_technic': models.ExcavationTechnicType} + base_models = ["documentation"] + associated_models = { + 'parcel': Parcel, 'unit': models.Unit, + 'documentation': models.DocumentationType, + 'excavation_technic': models.ExcavationTechnicType} pk = forms.IntegerField(required=False, widget=forms.HiddenInput) operation_id = forms.IntegerField(widget=forms.HiddenInput) parcel = forms.ChoiceField(label=_("Parcel"), choices=[]) @@ -146,10 +149,15 @@ class RecordFormGeneral(ManageOldType, forms.Form): length = forms.FloatField(label=_(u"Length (m)"), required=False) width = forms.FloatField(label=_(u"Width (m)"), required=False) thickness = forms.FloatField(label=_(u"Thickness (m)"), required=False) + diameter = forms.FloatField(label=_(u"Diameter (m)"), required=False) depth = forms.FloatField(label=_(u"Depth (m)"), required=False) - unit = forms.ChoiceField(label=_("Context record type"), required=False, choices=[]) - has_furniture = forms.NullBooleanField(label=_(u"Has furniture?"), - required=False) + depth_of_appearance = forms.FloatField( + label=_(u"Depth of appearance (m)"), required=False) + unit = forms.ChoiceField(label=_(u"Context record type"), required=False, + choices=[]) + documentation = forms.MultipleChoiceField( + label=_("Documentation"), choices=[], required=False, + widget=forms.CheckboxSelectMultiple) location = forms.CharField( label=_(u"Location"), widget=forms.Textarea, required=False, validators=[validators.MaxLengthValidator(200)]) @@ -216,6 +224,11 @@ class RecordFormGeneral(ManageOldType, forms.Form): initial=self.init_data.get('excavation_technic')) self.fields['excavation_technic'].help_text = \ models.ExcavationTechnicType.get_help() + self.fields['documentation'].choices = \ + models.DocumentationType.get_types(empty_first=False, + initial=self.init_data.get('documentation')) + self.fields['documentation'].help_text = \ + models.DocumentationType.get_help() def clean(self): # manage unique context record ID |