As a note, I found this post which basically describes my current
issue.

http://groups.google.com/group/django-users/browse_thread/thread/70c01c357d2f5e9b/6b0ec468b69398cd?lnk=gst&q=best+practice+error+form#6b0ec468b69398cd

The only problem is that I can't use the PRG approach. Half way
through my steps I don't want forms to be displayed via URL/GET params
because there will be sensitive info involved.

Seems to be leaning more and more towards sessions as my only option?

Thanks :)

On Apr 28, 3:49 pm, TheCorp <jjos...@keystreams.com> wrote:
> Hey all, fairly new to the Django community and trying to get a small
> side project going. Basically im running into an issue with
> architecture in that I am not sure how to proceed.
>
> Basically I am trying to code up a reservation system which spans a
> few pages. Select a few things, input some text, add your billing info
> and reserve. So the problem I am running into and I am fairly certain
> this is from my own ineptitude, is that I am not sure the right way to
> pass data between all of the pages.
>
> Nothing gets posted to the db till the end of the process but data
> needs to be saved through each step because each step relies on the
> data submitted from the previous step and all the steps before it.
> Originally I wasn't even using Django Forms, I was just using Views/
> Templates. Each page would have an HTML form that would POST to the
> next page/view and I would keep pushing data on via <input
> type="hidden"> tags.
>
> After reading about Django Forms I figured that would be a good way to
> go about doing it because I liked the idea of the built in validation
> hooks. The problem I am running into now is that I have each step in
> the process represented by a Form and in the template each HTML form
> POSTs back to itself. This way I can check whether its validated
> before moving on to the next step. The problem I have is that once I
> have validated (is_valid()) that the form data was submitted
> correctly, I can't seem to pass the request.POST data or the Form
> itself onto the next page.
>
> I tried return render_to_response('template.html', {'form':form})
> which passes the data correctly to a template but then the URL is
> messed up because its still the original URL from when the form posted
> to itself and things get funky with my URLConf. I also tried to return
> via HttpResponseRedirect() with different combinations (using reverse
> () and other things) but I still can't seem to pass the POST data
> correctly.
>
> So basically either I am not understanding how Forms work or I need to
> use something else like Formsets/Sessions/FormWizard. Anyone have any
> suggestions? My current idea is to use sessions to store the variables
> as they flow through the process and POST everything in the final step
> but tell me what you think. Thanks!
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to