From efa898a8c6c55f6f089020ed1439796f9850eda0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 23 Dec 2016 14:21:57 +0100 Subject: Treament: add state field (refs #3394) --- archaeological_finds/forms_treatments.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'archaeological_finds/forms_treatments.py') 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 -- cgit v1.2.3