diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-21 23:53:23 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-21 23:53:23 +0100 |
| commit | 9eacb3f2b2f5819ef3eea1a54bb2c4bfb13efda6 (patch) | |
| tree | 2a2b687acef6f878c05f7148a150c10c3a7fb71a /archaeological_context_records/forms.py | |
| parent | 8eb09a666e7048ce8e531649566418670d94036d (diff) | |
| parent | c00bb6298a602f74c55cfd60b8601295470a8e3b (diff) | |
| download | Ishtar-9eacb3f2b2f5819ef3eea1a54bb2c4bfb13efda6.tar.bz2 Ishtar-9eacb3f2b2f5819ef3eea1a54bb2c4bfb13efda6.zip | |
Merge branch 'master' into v0.9
Conflicts:
Makefile.example
archaeological_operations/migrations/0061_regenerate_cached_label.py
archaeological_warehouse/migrations/0024_generate_cache_lbl_for_containers.py
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 |
