summaryrefslogtreecommitdiff
path: root/archaeological_context_records/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-13 15:38:34 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-13 15:38:34 +0100
commit21d0824fadb5be4b7396695cf22f3db1f9b6d1a3 (patch)
treebe5fee1bbabb81eb009f4e6f6872e3aa79c4b05e /archaeological_context_records/forms.py
parent5702e82ea2b7966f503261cd5cb6b130740c08c7 (diff)
downloadIshtar-21d0824fadb5be4b7396695cf22f3db1f9b6d1a3.tar.bz2
Ishtar-21d0824fadb5be4b7396695cf22f3db1f9b6d1a3.zip
Context record: add type of excavation technics (refs #3487)
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r--archaeological_context_records/forms.py10
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