> But I run into trouble when saving in sessions via clean_data and then
> trying to initiate a newform with the saved clean_data. This occurs
> only when ForeignKeys are in the Game.
>
> This is probably due to the nature foreignkeys are stored as an object
> in clean_data (see below).

Correct. ModelChoiceField's clean_data results in the corresponding
related object instance and not its id.

That makes your form.clean_data a dictionary that can not be used to
instantiate a new form.

What is the flow of your 3 screens? Are you populating a single form
partially through each of three form submits? Do you need the
clean_data at each step (for example, are you validating on each
screen or only on the final screen)?

You could store a copy of request.POST into your session instead of
form.clean_data. Then at each stage you get the current
request.POST.copy() and update it with the session's stored
request.POST.copy() and use that merged dictionary to instantiate that
stage's form. I am sure that there are other ways to skin this one
once you tell us a bit more about the flow you are looking to design.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to