diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-04 11:48:54 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-04 11:48:54 +0100 |
commit | 5487417e1721ea8bae2eec996b8f8c870559cea7 (patch) | |
tree | 447a5bbe4dfaf730b99ff59cf51a259a66f3b85e /archaeological_finds/forms_treatments.py | |
parent | ba7ca48fdfdd927beab3bafe557333e3aef2e423 (diff) | |
download | Ishtar-5487417e1721ea8bae2eec996b8f8c870559cea7.tar.bz2 Ishtar-5487417e1721ea8bae2eec996b8f8c870559cea7.zip |
Custom form: administrativ act forms
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
-rw-r--r-- | archaeological_finds/forms_treatments.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index 93a98bf1a..4e5994ca9 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -380,15 +380,14 @@ class AdministrativeActTreatmentFormSelection( class AdministrativeActTreatmentForm(AdministrativeActOpeForm): + form_admin_name = _(u"Treatment - Administrative act - General") + form_slug = "treatment-adminact-general" act_type = forms.ChoiceField(label=_(u"Act type"), choices=[]) - def __init__(self, *args, **kwargs): - super(AdministrativeActTreatmentForm, self).__init__(*args, **kwargs) - self.fields['act_type'].choices = ActType.get_types( - initial=self.init_data.get('act_type'), - dct={'intented_to': 'T'}) - self.fields['act_type'].help_text = ActType.get_help( - dct={'intented_to': 'T'}) + TYPES = [ + FieldType('act_type', ActType, + extra_args={"dct": {'intented_to': 'T'}}), + ] class AdministrativeActTreatmentModifForm( @@ -637,16 +636,14 @@ class AdministrativeActTreatmentFileFormSelection( class AdministrativeActTreatmentFileForm(AdministrativeActOpeForm): + form_admin_name = _(u"Treatment request - Administrative act - General") + form_slug = "treatmentfile-adminact-general" act_type = forms.ChoiceField(label=_(u"Act type"), choices=[]) - def __init__(self, *args, **kwargs): - super(AdministrativeActTreatmentFileForm, self).__init__(*args, - **kwargs) - self.fields['act_type'].choices = ActType.get_types( - initial=self.init_data.get('act_type'), - dct={'intented_to': 'TF'}) - self.fields['act_type'].help_text = ActType.get_help( - dct={'intented_to': 'TF'}) + TYPES = [ + FieldType('act_type', ActType, + extra_args={"dct": {'intented_to': 'TF'}}), + ] class AdministrativeActTreatmentFileModifForm( |