Re: [Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Carl Franks wrote: I made on very basic start [1] on being able to automatically create constraints from the database column types. At the moment it only supports mysql, and it's also probably very out-of-sync with the current svn trunk - but I'd /really/ like to see it finished, and I /really/

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Carl Franks
On 03/11/06, Ian Docherty [EMAIL PROTECTED] wrote: Carl Franks wrote: I made on very basic start [1] on being able to automatically create constraints from the database column types. At the moment it only supports mysql, and it's also probably very out-of-sync with the current svn trunk -

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Matt S Trout
Ian Docherty wrote: My problem is finding a clean way of getting these constraints out of the Model and into the View so that I can generate meaningful error messages without hard-coding them in the templates. By 'clean' I mean not having to code the Controller to act as the middle-man and

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Rodney Broom
From: Ian Docherty [EMAIL PROTECTED] Putting these sort of constraints is the duty of either the database level (where they naturally go anyway) or perhaps in the business logic layer. Right, constraints can come from both. I think the question is how to communicate those contraints up the

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Yes this pretty much agrees with my interpretation. It is not so much the location of the constraint rules as how to propagate them to the view (i.e the stash) John Siracusa wrote: Keep in mind that there are at least three possible levels of constraints in a database-backed web app. 1.

Re: [Catalyst] Where should constraints go

2006-11-03 Thread John Siracusa
On 11/3/06, Ian Docherty [EMAIL PROTECTED] wrote: Yes this pretty much agrees with my interpretation. It is not so much the location of the constraint rules as how to propagate them to the view (i.e the stash) Do you mean for the purposes of client-side validation? Or do you just mean how to

Re: [Catalyst] Where should constraints go

2006-11-03 Thread John Siracusa
On 11/3/06, Ian Docherty [EMAIL PROTECTED] wrote: One thing occurs to me. What I want to do is to get parameters from the Model (or the Business layer) into the View via the stash. So for a User object I want be able to do something like. td align=left class=errorUsername must be between [%