Created
October 24, 2013 04:17
-
-
Save chriskief/7131301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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