summaryrefslogtreecommitdiff
path: root/archaeological_finds/forms_treatments.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-12-23 14:21:57 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-12-23 14:21:57 +0100
commitbce2746a497ad1eca5633a7af31e562b9c196204 (patch)
treec061715edfe0d35a5df660f6224723cda5bc4c1b /archaeological_finds/forms_treatments.py
parent9caeb73d10497049b3bc27f58621e544115a738a (diff)
downloadIshtar-bce2746a497ad1eca5633a7af31e562b9c196204.tar.bz2
Ishtar-bce2746a497ad1eca5633a7af31e562b9c196204.zip
Treament: add state field (refs #3394)
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
-rw-r--r--archaeological_finds/forms_treatments.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py
index caaf70f5a..5f3fc6496 100644
--- a/archaeological_finds/forms_treatments.py
+++ b/archaeological_finds/forms_treatments.py
@@ -83,6 +83,7 @@ class BaseTreatmentForm(ManageOldType, forms.Form):
'location': Warehouse,
'organization': Organization,
'container': Container,
+ 'treatment_state': models.TreatmentState,
}
file_upload = True
need_user_for_initialization = True
@@ -98,6 +99,8 @@ class BaseTreatmentForm(ManageOldType, forms.Form):
treatment_type = forms.MultipleChoiceField(
label=_(u"Treatment type"), choices=[],
widget=widgets.CheckboxSelectMultiple)
+ treatment_state = forms.ChoiceField(label=_(u"Treatment state"),
+ choices=[], required=False)
target_is_basket = forms.NullBooleanField(label=_(u"Target"))
person = forms.IntegerField(
label=_(u"Responsible"),
@@ -162,6 +165,12 @@ class BaseTreatmentForm(ManageOldType, forms.Form):
self.fields['treatment_type'].help_text = \
models.TreatmentType.get_help(
dct={'upstream_is_many': False, 'downstream_is_many': False})
+ self.fields['treatment_state'].choices = \
+ models.TreatmentState.get_types(
+ initial=self.init_data.get('treatment_state'),
+ )
+ self.fields['treatment_state'].help_text = \
+ models.TreatmentState.get_help()
# TODO
"""
self.fields['basket'].required = False