UPDATE:
I found a workaround, but it's not pretty. Has anyone done this in a
more elegant manner?
1) when defining the initial data to pass into the FormWizard (I do
this in a view wrapped around the FormWizard):
if len(request.FILES):
initial.update({'request_files':request.FILES})
2) Override the FormWizard subclass's __init__ method and tack the
files onto the object so they can be accessed later:
def __init__(self, form_list, initial=None):
files = initial.get('request_files', None)
super(ProfileWizard, self).__init__(form_list, initial)
self.files = files
3) Override get_form to pass the files as a parameter to the form:
def get_form(self, step, data=None):
return self.form_list[step](data,
prefix=self.prefix_for_step(step),
initial=self.initial.get(step, None), files=self.files)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---