My FormWizard (Django 1.4) allows the user to step back and forth until he completes the wizard. The wizard keeps all the values the user filled in and displays them in case
I recently run into the same problem, and could solve it by subclassing Django's SessionWizardView (in my case NamedUrlSessionWizardView), and overriding the get_form method.
Basicly I do the the following:
Here is the code:
from django.contrib.formtools.wizard.views import NamedUrlSessionWizardView
class MyWizardView(NamedUrlSessionWizardView):
def get_form(self, step=None, data=None, files=None):
if step:
step_files = self.storage.get_step_files(step)
else:
step_files = self.storage.current_step_files
if step_files and files:
for key, value in step_files.items():
if files.has_key(key) and files[key] is not None:
step_files[key] = files[key]
elif files:
step_files = files
return super(MyWizardView, self).get_form(step, data, step_files)