Author: phd
Date: 2005-01-05 13:15:21 +0000 (Wed, 05 Jan 2005)
New Revision: 513
Modified:
trunk/SQLObject/sqlobject/col.py
Log:
Allowed sqlbuilder.SQLExpression and descendants in IntValidator.
Modified: trunk/SQLObject/sqlobject/col.py
===================================================================
--- trunk/SQLObject/sqlobject/col.py 2005-01-05 12:24:45 UTC (rev 512)
+++ trunk/SQLObject/sqlobject/col.py 2005-01-05 13:15:21 UTC (rev 513)
@@ -378,7 +378,7 @@
def fromPython(self, value, state):
if value is None:
return None
- if not isinstance(value, (int, long)):
+ if not isinstance(value, (int, long, sqlbuilder.SQLExpression)):
raise TypeError, "expected an int in the IntCol '%s', got %s instead" % \
(self.name, type(value))
return value
@@ -386,7 +386,7 @@
def toPython(self, value, state):
if value is None:
return None
- if not isinstance(value, (int, long)):
+ if not isinstance(value, (int, long, sqlbuilder.SQLExpression)):
raise TypeError, "expected an int in the IntCol '%s', got %s instead" % \
(self.name, type(value))
return value
|