OK. This approach works. Thanks. Would you have any link to a best practice where such a approach is detailed?
Thx.. Jim On Nov 2, 10:01 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-11-02 at 06:26 -0700, jim wrote: > > Hello, > > I have a form that accepts some data. If the data is invalid, the > > server side validation should detect this, redirect to the original > > url and display error messages. > > I think your design is a bit backwards here. try to avoid using a > redirect. Why doesn't the view processing the form know which URL to > display and why can't it do this directly (fill in the form template and > return that as the result)? > > Often you can organise things so that doing a GET on the form URL > displays the form and doing a POST to the same URL submits the data. > Then, if the form submission is successful, you can redirect (because > the follow-up is a GET) to the target page you want them to end up at. > That's a pretty good design to aim for. > > Regards, > Malcolm > > -- > He who laughs last thinks slowest.http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---