Re: quick sanity check on hooking up params::validate to cdbi subclasses.

[prev] [thread] [next] [Date index for 2005/07/28]

From: Perrin Harkins
Subject: Re: quick sanity check on hooking up params::validate to cdbi subclasses.
Date: 15:17 on 28 Jul 2005
On Wed, 2005-07-27 at 20:59 -0700, George Hartzell wrote:
> Do you also use before_set_COLUMN hooks to get at updates?

No, I only use this to make sure all required params are being sent in.
I do this because MySQL doesn't provide a useful way to make the
database require fields that are not part of the primary key.

> Is there a particular reason that you override create instead of using
> combinations of before_set_COL and create hooks?

Yes, I found them much more difficult to work with.  In particular,
validate_column_values gets called when individual columns get set as
well as when create() gets called, so you have to handle two totally
different situations.  In my case, I decided it was enough to just make
sure the required values were there during create() calls.

- Perrin

Re: quick sanity check on hooking up params::validate to cdbi subclasses.
Perrin Harkins 15:17 on 28 Jul 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52