Re: [SQLObject] Re: problem: implementing BoolCol
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Nick <ni...@dd...> - 2003-05-05 18:50:13
|
On Mon, 2003-05-05 at 12:52, Ian Bicking wrote: > On Wed, 2003-04-30 at 12:41, Nick wrote: > > 3) for each db api, there needs to be convert-from-result-to-python and > > convert-from-python-to-sql-value functions as part of the Col class, > > encapsulated by the mechanism described in 2. > > > I've been working on a validation/conversion system for a form > processor. I'm fairly happy with what I've got, at least for forms, and > it could be applied to SQLObject -- though I wonder if it's too heavy, > since it would be invoked for every get or set of a column. It makes > composition and definition of validators easier, but maybe that's not as > important for something like SQLObject, where there's a lot more work in > defining an object than just its validators. 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. Nick |