Re: Separate views for form display and handling

2009-12-11 Thread Preston Holmes
On Dec 11, 5:20 am, Aaron wrote: > On Dec 10, 6:04 pm, aa56280 wrote: > > > if form.is_valid(): > >   # do something and redirect > > else: > >   render_to_response('foo.html', {'form' : form'}) > > Would that leave the URL as displayed in the browser the same as the > one for the form handling

Re: Separate views for form display and handling

2009-12-11 Thread Aaron
On Dec 10, 6:04 pm, aa56280 wrote: > if form.is_valid(): >   # do something and redirect > else: >   render_to_response('foo.html', {'form' : form'}) Would that leave the URL as displayed in the browser the same as the one for the form handling view? -- You received this message because you are

Re: Separate views for form display and handling

2009-12-10 Thread aa56280
> render_to_response('foo.html', {'form' : form'}) Forgot to add: the form instance in this case will be bound to the submitted data and will contain the appropriate errors. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Separate views for form display and handling

2009-12-10 Thread aa56280
First of all, any reason why you're using different views and not the same view? Second, yes it's possible to do what you're trying to do. Try this: if form.is_valid(): # do something and redirect else: render_to_response('foo.html', {'form' : form'}) -- You received this message because yo

Separate views for form display and handling

2009-12-10 Thread Aaron
I have a page with a form on it, and I want to use a separate view function to handle the form submission and redirect to the page view. So, the form's action would be "action="{% url views.handleform %}". This works fine when the form has no errors; it just needs a simple HttpRedirectResponse. Ho