diff options
Diffstat (limited to 'archaeological_context_records/forms.py')
| -rw-r--r-- | archaeological_context_records/forms.py | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 953d33417..2506ae857 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -130,7 +130,8 @@ class RecordFormSelection(forms.Form):  class RecordFormGeneral(ManageOldType, forms.Form):      form_label = _("General")      file_upload = True -    associated_models = {'parcel': Parcel, 'unit': models.Unit} +    associated_models = {'parcel': Parcel, 'unit': models.Unit, +                         '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,6 +141,8 @@ 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 technic"), 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) @@ -208,6 +211,11 @@ 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()      def clean(self):          # manage unique context record ID  | 
