Hi,
I've read through alot of posts on filefields but cant find anything
that's obviously related to my problem. I've got a model that has a
filefield, charField, textField, few dateTime fields, foreign keys,
charfield with choices. A good mix.
Right now when the user populates the form to create one of these
objects, and if there are errors the form is re-displayed to the user.
All my fields are populated with the data the user entered except the
FileField. This is really annoying as the User needs to re-browse for
the file again.
Below is some of the code for the view:
if it's a post:
new_data = request.POST.copy()
new_data.update(request.FILES)
errors = manipulator.get_validation_errors(new_data)
if errors:
form = forms.FormWrapper(manipulator, new_data, errors)
context['form'] = form
return render_to_response('myCreateForm.html', context)
I've tried it with "new_data = manipulator.flatten_data()" before the
FormWrapper line but no success.
If someone could help me on this it would be great. Maybe it's not
possible? I cant be the only one!
Regards,
Pat.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---