Re: [SQLObject] Re: problem: implementing BoolCol
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-05-05 19:38:27
|
On Mon, 2003-05-05 at 13:49, Nick wrote: > I haven't seen the form stuff you're talking about (cvs.sf.net doesn't > respond at the moment), but you only really need to do the conversion > when updating the db, which is another case for pythonic transaction > handling. Validation in most cases is lightweight, even if you're only > going to match against a re, but necessary if you want to catch problems > before they happen. If you didn't want validation, should should have > used Col. Either that, or you can subclass XxxCol and override the > validator to pass, assuming you move the validator into the class. It should go both ways, so you can define the class of the result -- maybe unpickling a string, or creating a Point class, etc. Essentially it came down to a Validator object with two defined methods -- fromPython and toPython. But there were a bunch of other options that may not apply to SQLObject. Validation may be important when fetching from the database, if SQLObject doesn't have total control of the database, and the constraints aren't as restrictive as the validation. That might be an obscure case, though. Ian |