Skip to content

Instantly share code, notes, and snippets.

@chriskief
Created Oct 24, 2013
Embed
What would you like to do?
class MyWizardView(SessionWizardView):
# this runs for the step it's on as well as for the step before
def get_form_initial(self, step):
# steps are named 'step1', 'step2', 'step3'
current_step = self.storage.current_step
# get the data for step 1 on step 3
if current_step == 'step3':
prev_data = self.storage.get_step_data('step1')
some_var = prev_data.get('step1-some_var','')
return self.initial_dict.get(step, {'some_var': some_var})
return self.initial_dict.get(step, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment