diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-21 23:59:27 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-21 23:59:27 +0100 |
commit | b8cf790377a2ece768ea19bd1d216fdf0ee78cda (patch) | |
tree | b72020ae9a2cee74a3060fc17495f445aa414e0e /archaeological_context_records/forms.py | |
parent | 456b74ac295815970483871cf2575863bc97dd6f (diff) | |
parent | 88fde9b54bd94e582fa4f8886463eda2e39ceb46 (diff) | |
download | Ishtar-b8cf790377a2ece768ea19bd1d216fdf0ee78cda.tar.bz2 Ishtar-b8cf790377a2ece768ea19bd1d216fdf0ee78cda.zip |
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r-- | archaeological_context_records/forms.py | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 953d33417..522c69deb 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -130,7 +130,11 @@ class RecordFormSelection(forms.Form): class RecordFormGeneral(ManageOldType, forms.Form): form_label = _("General") file_upload = True - associated_models = {'parcel': Parcel, 'unit': models.Unit} + 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=[]) @@ -140,13 +144,20 @@ class RecordFormGeneral(ManageOldType, forms.Form): widget=forms.Textarea, required=False) comment = forms.CharField(label=_(u"General comment"), widget=forms.Textarea, required=False) + excavation_technic = forms.ChoiceField( + label=_(u"Excavation technique"), choices=[], required=False) 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)]) @@ -208,6 +219,16 @@ class RecordFormGeneral(ManageOldType, forms.Form): self.fields['unit'].choices = models.Unit.get_types( initial=self.init_data.get('unit')) self.fields['unit'].help_text = models.Unit.get_help() + self.fields['excavation_technic'].choices = \ + models.ExcavationTechnicType.get_types( + 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 |