diff options
author | Valérie-Emma Leroux <emma@iggdrasil.net> | 2017-04-07 11:40:31 +0200 |
---|---|---|
committer | Valérie-Emma Leroux <emma@iggdrasil.net> | 2017-04-07 11:40:31 +0200 |
commit | 7f22d3c20cc24debfe123425efa63ec5293e4b4c (patch) | |
tree | f773b80964981c231c892ee5255b94285bc5620a /archaeological_context_records/forms.py | |
parent | 9127307734c85b816ac7dbb539b565ffb106d60f (diff) | |
parent | da4af2ab5d105f6d2ce442b517e532b7570616e3 (diff) | |
download | Ishtar-7f22d3c20cc24debfe123425efa63ec5293e4b4c.tar.bz2 Ishtar-7f22d3c20cc24debfe123425efa63ec5293e4b4c.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 |