diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-07-01 12:21:07 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-07-01 12:21:07 +0200 |
| commit | 415c9e56882b1ab78afed0376ce643dc079ea0b8 (patch) | |
| tree | adc16794a6ffd669e3ea5922a8979269858d46de /archaeological_finds/views.py | |
| parent | 0edc29b720541ba265b98e7df8c943f5cebc617e (diff) | |
| download | Ishtar-415c9e56882b1ab78afed0376ce643dc079ea0b8.tar.bz2 Ishtar-415c9e56882b1ab78afed0376ce643dc079ea0b8.zip | |
Treatments: manage conditional forms
Diffstat (limited to 'archaeological_finds/views.py')
| -rw-r--r-- | archaeological_finds/views.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index e55291a76..8bae9785c 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -319,26 +319,22 @@ class DeleteFindBasketView(IshtarMixin, LoginRequiredMixin, FormView): treatment_creation_wizard = TreatmentWizard.as_view([ ('basetreatment-treatment_creation', BaseTreatmentForm), - # ('selecfind-treatment_creation', UpstreamFindFormSelection), - ('multiselecfinds-treatment_creation', FindMultipleFormSelection), + ('selecfind-treatment_creation', UpstreamFindFormSelection), ('resultfind-treatment_creation', ResultFindForm), ('resultfinds-treatment_creation', ResultFindFormSet), ('final-treatment_creation', FinalForm)], condition_dict={ 'selecfind-treatment_creation': - check_treatment('basetreatment-treatment_creation', - 'treatment_type', not_type_list=[ - 'physical_grouping', 'packaging']), - 'multiselecfinds-treatment_creation': - check_treatment('basetreatment-treatment_creation', - 'treatment_type', ['physical_grouping', - 'packaging']), + check_not_exist('basetreatment-treatment_creation', + 'basket'), 'resultfinds-treatment_creation': - check_treatment('basetreatment-treatment_creation', - 'treatment_type', ['split']), + check_type_field('basetreatment-treatment_creation', + 'treatment_type', models.TreatmentType, + 'downstream_is_many'), 'resultfind-treatment_creation': - check_treatment('basetreatment-treatment_creation', - 'treatment_type', not_type_list=['split'])}, + check_type_field('basetreatment-treatment_creation', + 'treatment_type', models.TreatmentType, + 'upstream_is_many')}, label=_(u"New treatment"), url_name='treatment_creation',) |
