[Catalyst] Re: Form validation in insert() and update()?

2007-05-21 Thread A. Pagaltzis
* Dave Rolsky <[EMAIL PROTECTED]> [2007-05-21 18:30]: > On Mon, 21 May 2007, A. Pagaltzis wrote: > >So if the blank form is `/order/form`, you’d stash the form > >data away somewhere under ID `7z32a` (f.ex) and redirect them > >to `/order/form/7z32a` (or `/order/form?populate=7z32a`). The > >data c

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-21 Thread Dave Rolsky
On Mon, 21 May 2007, A. Pagaltzis wrote: So if the blank form is `/order/form`, you’d stash the form data away somewhere under ID `7z32a` (f.ex) and redirect them to `/order/form/7z32a` (or `/order/form?populate=7z32a`). The data could be in the session, as long as it’s keyed off of an ID that s

[Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread A. Pagaltzis
* Dave Rolsky <[EMAIL PROTECTED]> [2007-05-20 22:10]: > On Sun, 20 May 2007, A. Pagaltzis wrote: > >Why not stash the message in the query string for the redirect > >target? Or a hash key. > > A couple problems. The biggest is that besides messages, I also > pass along the submitted form data, so

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread Matt S Trout
On Sun, May 20, 2007 at 04:14:06PM -0500, Dave Rolsky wrote: > On Sun, 20 May 2007, Bogdan Lucaciu wrote: > > >On Sunday 20 May 2007 22:58:26 Dave Rolsky wrote: > >>A couple problems. The biggest is that besides messages, I also pass along > >>the submitted form data, so the form can be displayed

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread Dave Rolsky
On Sun, 20 May 2007, Bogdan Lucaciu wrote: On Sunday 20 May 2007 22:58:26 Dave Rolsky wrote: A couple problems. The biggest is that besides messages, I also pass along the submitted form data, so the form can be displayed with what the user submitted. That won't fit in a query string in many ca

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread Bogdan Lucaciu
On Sunday 20 May 2007 22:58:26 Dave Rolsky wrote: > A couple problems. The biggest is that besides messages, I also pass along > the submitted form data, so the form can be displayed with what the user > submitted. That won't fit in a query string in many cases. if the post is handled by /order/ne

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread Dave Rolsky
On Sun, 20 May 2007, A. Pagaltzis wrote: * Dave Rolsky <[EMAIL PROTECTED]> [2007-05-20 16:40]: If the action is a create or update, you want to redirect to the URI for the thing being created or updated. You may _also_ want to include some form "successfully updated" message, so this pattern wo

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread mla
A. Pagaltzis wrote: * Dave Rolsky <[EMAIL PROTECTED]> [2007-05-20 16:40]: If the action is a create or update, you want to redirect to the URI for the thing being created or updated. You may _also_ want to include some form "successfully updated" message, so this pattern works well for this. Tha

[Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread A. Pagaltzis
* Dave Rolsky <[EMAIL PROTECTED]> [2007-05-20 16:40]: > If the action is a create or update, you want to redirect to > the URI for the thing being created or updated. You may _also_ > want to include some form "successfully updated" message, so > this pattern works well for this. That's not very RE

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread Dave Rolsky
On Sun, 20 May 2007, Matt S Trout wrote: I used to do that, but I've found that what I thought were style reasons mostly turned out to be insufficiently flexible tooling reasons and I'm finding one URI works pretty well under Cat. Would you mind elaborating as to why you're keeping separate URI

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread Matt S Trout
On Sun, May 20, 2007 at 12:39:00AM -0500, Dave Rolsky wrote: > No, I mean the session. I always keep the URIs for my form display and > form submission separate, and I do a redirect after form submission. I used to do that, but I've found that what I thought were style reasons mostly turned out t

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-19 Thread Dave Rolsky
On Sun, 20 May 2007, A. Pagaltzis wrote: * Dave Rolsky <[EMAIL PROTECTED]> [2007-05-15 01:00]: eval { $user->update( %bunch_of_stuff ); }; if ( my $e = Exception::Class->caught( 'My::App::Exception::DataValidation') ) { # $e->errors contains multiple data validation error messa

[Catalyst] Re: Form validation in insert() and update()?

2007-05-19 Thread A. Pagaltzis
* Dave Rolsky <[EMAIL PROTECTED]> [2007-05-15 01:00]: > eval > { > $user->update( %bunch_of_stuff ); > }; > > if ( my $e = Exception::Class->caught( > 'My::App::Exception::DataValidation') ) > { > # $e->errors contains multiple data validation error messages > # stuff them in