conditional form intermediate versionnot working version
This commit is contained in:
parent
4c7d5855a7
commit
5d8525671c
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue