diff options
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 |