conditional form intermediate versionnot working version

This commit is contained in:
Benni Bärmann 2020-10-05 15:53:00 +02:00
parent 4c7d5855a7
commit 5d8525671c
1 changed files with 18 additions and 6 deletions

View File

@ -34,12 +34,24 @@ class ExternView(CookieWizardView):
template_name = "input/extern.html" template_name = "input/extern.html"
form_list = [VolunteerForm, LibraryForm] form_list = [VolunteerForm, LibraryForm]
def process_step(self, form): # def process_step(self, form):
if form.cleaned_data.get('choice') == 'IFG': # if form.cleaned_data.get('choice') == 'IFG':
# print ('IFG detected!')
# self.form_list = [VolunteerForm, IFGForm]
# print('leaving process_step()')
# return self.get_form_step_data(form)
def get_form(self, step=None, data=None, files=None):
if step:
print ("get_form() step " + step)
if step == '1':
print('iiiooopppp')
data = self.get_cleaned_data_for_step('0')
print (data)
if data.get('choice') == 'IFG':
print ('IFG detected!') print ('IFG detected!')
self.form_list = [VolunteerForm, IFGForm] form = super().get_form(step, data, files)
print('leaving process_step()') return form
return self.get_form_step_data(form)
def done(self, form_list, **kwargs): def done(self, form_list, **kwargs):
print('ExternView.done() reached') print('ExternView.done() reached')