Re: [RDBO] form validation and RDBO

2007-10-25 Thread Peter Karman
On 10/15/2007 01:45 PM, Peter Karman wrote: > So I'm going to dive in and work on such a thing. In the Rose::DBx::Garden > namespace. http://search.cpan.org/~karman/Rose-DBx-Garden-0.01/ Coming to a mirror near you. Thanks to [EMAIL PROTECTED] for lots of feedback and patches. This is flagge

Re: [RDBO] form validation and RDBO

2007-10-23 Thread John Siracusa
On 10/23/07, Bill Moseley <[EMAIL PROTECTED]> wrote: >> We have quite the existing translation system here at work (all our >> business is overseas and we do 16 different languages), and using >> English as the key is pretty much a non-starter in our system. (It >> also makes it a bit harder to ch

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Bill Moseley
On Tue, Oct 23, 2007 at 02:30:01PM -0400, John Siracusa wrote: > > Do you to be able to display the error message along with the field's > > lable? For example: > > Was that supposed to say, "do you want to be able to"? That will work. It was suppose to bee "Do you mean to be able to" display t

Re: [RDBO] form validation and RDBO

2007-10-23 Thread John Siracusa
On 10/23/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: > Personally, I always use keys, and consider _AUTO and the exposure > ERR_WRONG_PASSWORD an all out failure. I've always wanted to have a test > module that scoured source for keys and ensured they were in all l18n files. My solution is

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Christopher H. Laco
Bill Moseley wrote: > On Tue, Oct 23, 2007 at 02:12:08PM -0400, Christopher H. Laco wrote: >> Bill Moseley wrote: >> [snip] >>> Yep, although I prefer to use English as the key to the language files >>> instead of an ID. Easier to understand when looking at specific >>> validation code. I can als

Re: [RDBO] form validation and RDBO

2007-10-23 Thread John Siracusa
On 10/23/07, Bill Moseley <[EMAIL PROTECTED]> wrote: > On Tue, Oct 23, 2007 at 01:27:17PM -0400, John Siracusa wrote: >> OTOH, the server often needs the labels in order to construct good error >> messages. An alternative is to pass error codes to the templates, but IME >> that tends to result in

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Bill Moseley
On Tue, Oct 23, 2007 at 02:12:08PM -0400, Christopher H. Laco wrote: > Bill Moseley wrote: > [snip] > > Yep, although I prefer to use English as the key to the language files > > instead of an ID. Easier to understand when looking at specific > > validation code. I can also fall back to using the

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Christopher H. Laco
Bill Moseley wrote: [snip] > Yep, although I prefer to use English as the key to the language files > instead of an ID. Easier to understand when looking at specific > validation code. I can also fall back to using the ID (the English > error message) if the lookup fails in the language file. >

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Bill Moseley
On Tue, Oct 23, 2007 at 01:27:17PM -0400, John Siracusa wrote: > OTOH, the server often needs the labels in order to construct good > error messages. An alternative is to pass error codes to the > templates, but IME that tends to result in templates with a lot of > code dedicated to figuring out w

Re: [RDBO] form validation and RDBO

2007-10-23 Thread John Siracusa
On 10/23/07, Peter Karman <[EMAIL PROTECTED]> wrote: >> I keep the labels in the html templates. I started using YAML files >> to define the fields and labels, but then I ended up with more places >> to define things than I felt was reasonable. > > Yes, that (labels in HTML) is what I do currently

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Christopher H. Laco
Peter Karman wrote: > > On 10/23/2007 11:29 AM, Bill Moseley wrote: > >>> lib/My/Thing.pm >>> lib/My/Thing/Form.pm >> Is that one form for each table kind of mapping? >> >> I might have multiple forms for each table (or groups to tables) and >> they are more related to the specific request (upd

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Peter Karman
On 10/23/2007 11:29 AM, Bill Moseley wrote: >> lib/My/Thing.pm >> lib/My/Thing/Form.pm > > Is that one form for each table kind of mapping? > > I might have multiple forms for each table (or groups to tables) and > they are more related to the specific request (update user profile vs. > upda

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Bill Moseley
Sorry, I have not been following this thread very much, so may be way off base. On Tue, Oct 23, 2007 at 09:48:41AM -0500, Peter Karman wrote: > Slightly different conventions. Rose::DBx::Garden puts a Form.pm class in next > to the RDBO class, so you'd get something like: > > lib/My/Thing.pm >

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Peter Karman
On 10/23/2007 11:14 AM, Peter Karman wrote: > Yes, I see your point. It jives with my experience as well. I am taking the > "derive form validation from db metadata as a starting point" approach. > > When I wrote about trying to tie the 2 together more closely, [snip] I should clarify: there

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Peter Karman
On 10/23/2007 10:08 AM, John Siracusa wrote: > Again, in every large web app I've created, each database table has > several forms that write into it--sometimes only writing partial > values. The HTML form layer is usually the most restrictive, the ORM > less so, and the db itself is the most p

Re: [RDBO] form validation and RDBO

2007-10-23 Thread adam . prime
Quoting Peter Karman <[EMAIL PROTECTED]>: > Adam, > > Glad you are working on this too. Perhaps we can join forces. > Certainly. I've only really started using Rose about a month ago, so i'm not sure how much use i'll be, but you never know ;) > I started something similar here: > > http://www

Re: [RDBO] form validation and RDBO

2007-10-23 Thread John Siracusa
On 10/23/07, Peter Karman <[EMAIL PROTECTED]> wrote: > The other thing I haven't yet got to (but was hoping to work on today) is some > ways to tie the validation pieces of RHTML and RDBO together so that the > validation code can be defined in one place. As Cees noted earlier in this > same thread

Re: [RDBO] form validation and RDBO

2007-10-23 Thread Peter Karman
On 10/22/2007 11:29 PM, [EMAIL PROTECTED] wrote: > I've been fooling around with this idea for the last couple of days > and I was wondering if I could get some feedback from the list. Adam, Glad you are working on this too. Perhaps we can join forces. I started something similar here: htt

Re: [RDBO] form validation and RDBO

2007-10-22 Thread adam . prime
I've been fooling around with this idea for the last couple of days and I was wondering if I could get some feedback from the list. Basically, what I've got working right now is a subclass of Loader, which creates all the RDBO .pm files (obviously), as well as RHTMLO 'stubs' that contain all

Re: [RDBO] form validation and RDBO

2007-10-15 Thread adam . prime
> > I find myself needing to bootstrap a bunch of Rose-based apps. Ideally, I'd > like to be able to run a script like: > > make_rose_garden.pl --db db_name --host some.where --prefix MyGarden > > and I would get RDBO .pm files, RHTMLO .pm files and some integrated > validation > glue, all gene

Re: [RDBO] form validation and RDBO

2007-10-15 Thread Peter Karman
On 07/15/2007 11:37 PM, Cees Hek wrote: > On 7/11/07, mla <[EMAIL PROTECTED]> wrote: >> Do most of you use Rose::HTML::Form to validate >> user-supplied data before constructing RDBO your >> RDBO objects? > > I do for many of my apps. > >> Do you define the form constraints separately from >> t

Re: [RDBO] form validation and RDBO

2007-07-15 Thread Cees Hek
On 7/11/07, mla <[EMAIL PROTECTED]> wrote: Do most of you use Rose::HTML::Form to validate user-supplied data before constructing RDBO your RDBO objects? I do for many of my apps. Do you define the form constraints separately from the RDBO model constraints? Or is there a way to reuse one or

Re: [RDBO] form validation and RDBO

2007-07-11 Thread Peter Karman
mla wrote on 7/11/07 12:51 AM: > Do most of you use Rose::HTML::Form to validate > user-supplied data before constructing RDBO your > RDBO objects? > I do. See http://search.cpan.org/dist/Catalyst-Controller-Rose/lib/Catalyst/Controller/Rose/CRUD.pm for example. > Do you define the form const

[RDBO] form validation and RDBO

2007-07-10 Thread mla
Do most of you use Rose::HTML::Form to validate user-supplied data before constructing RDBO your RDBO objects? Do you define the form constraints separately from the RDBO model constraints? Or is there a way to reuse one or the other? Thanks, Maurice