diff options
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 |
commit | efa898a8c6c55f6f089020ed1439796f9850eda0 (patch) | |
tree | c061715edfe0d35a5df660f6224723cda5bc4c1b /archaeological_finds/forms_treatments.py | |
parent | 57926eb4a3b7c3182d56e1c9e2818d0e2def9fe2 (diff) | |
download | Ishtar-efa898a8c6c55f6f089020ed1439796f9850eda0.tar.bz2 Ishtar-efa898a8c6c55f6f089020ed1439796f9850eda0.zip |
Treament: add state field (refs #3394)
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
-rw-r--r-- | archaeological_finds/forms_treatments.py | 9 |
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 |