Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chriskief
Created October 24, 2013 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriskief/7131301 to your computer and use it in GitHub Desktop.
Save chriskief/7131301 to your computer and use it in GitHub Desktop.
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