On 20/03/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 20, 2006 at 10:15:11AM +0000, Ed Singleton wrote:
> > I've googled for validators and can't seem to find anything concrete
> > on validators in SQLObject.
>
> Read sqlobject/col.py - it's the file where all column classes are
> declared. Look into sqlobject/tesst/test_validators.py for examples.
I had a look trhough col.py and struggled quite a bit, but I did
discover that I can do this:
for column in Contact.sqlmeta.columnList:
print column._mysqlType()
so that I can use that to work out what sort of validation I need for
each column. I can just iterate through all my data, and change the
type of each column based on the _mysqltype of the column in sqlmeta.
I couldn't work out how to return a string with the SO_type of the
column (such as SOIntCol) though. (Which would be preferable as it's
more generic).
Unfortunately I don't seem to have the tests directory in SQLObject,
so I couldn't look in there for help.
Any more clues greatly appreciated.
Thanks
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