On 20/03/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 20, 2006 at 12:42:33PM +0000, Ed Singleton wrote:
> > Unfortunately I don't seem to have the tests directory in SQLObject,
> > so I couldn't look in there for help.
>
> Download and unpack my unofficial tarballs:
>
> http://phd.pp.ru/Software/Python/misc/SQLObject/
Ah, the validators are in FormEncode! The FormEncode website has lots
of lovely info on them...
Thanks for the unofficial tarballs. The tests module does indeed
include enough info for me to get going.
I would still like to do this automatically based on the type of the
column to save having to type out the validator for every single
field.
Could I maybe do this by subclassing each IntCol, StringCol, etc to
MyIntCol, MyStringCol, etc, and adding the requsite validator to my
subclass, and using that? Would that break other things that use
SQLObject (like TurboGears)?
I was thinking something like:
class MyStringCol(IntCol):
validator=validators.String()
class Contact(SQLObject):
name = MyStringCol()
(or something. I don't know...)
(Otherwise I would do a search and replace on my code, to change
StringCol( to StringCol(validator=... but that feels like the wrong
kind of thing to be doing)
Ed
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss