I'm trying to apply a constraint but simply it doesnt work!!! I Really dont
know what i'm doing bad.
from sqlobject import *
sqlhub.processConnection = connectionForURI('mysql://***:[EMAIL PROTECTED]/***')
def isCapital(obj, col, value):
#IT NEVER GET PRINTED !!!
print 'hi'
if value != value.capitalize():
raise constraints.BadValue('Its not capitalized !!!', obj, col,
value)
class kindperson(SQLObject):
kind = StringCol()
people = MultipleJoin('person')
class person(SQLObject):
name = StringCol(constraints=[isCapital])
lastname = StringCol(constraints=[isCapital])
kind = ForeignKey('kindperson')
#HERE MUST RAISE THE BADVALUE EXCEPTION BUT DOESNT
p = person(name='jeff', lastname='bridges', kind=2)
-------------------------------------------------------
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&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss