Is it possible to update a list within a class based on instance details?
I would like to do something like this:
from formtools.wizard.views import SessionWizardView
class ContactWizard(SessionWizardView):
form_list = [ # a list of forms used per step
(S1, Q1),
(S2, Q2),
(S3, Q3),
]
def form_updater(self):
if self.get_cleaned_data_for_step("0") != None:
form_list.append((S3, Q3),)
return form_list
#However, I get thrown an error when I try to make the following call:
ContactWizard.form_updater(ContactWizard)
## error:
get_cleaned_data_for_step() missing 1 required positional argument: 'step'
Any help or guidance that you can provide would be VERY greatly appreciated.
It looks like you want a
classmethod: