Author: phd
Date: 2010-03-22 11:38:29 -0600 (Mon, 22 Mar 2010)
New Revision: 4156
Modified:
SQLObject/trunk/sqlobject/col.py
Log:
The internal representation for UnicodeCol is str for now, not unicode.
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2010-03-22 17:36:22 UTC (rev 4155)
+++ SQLObject/trunk/sqlobject/col.py 2010-03-22 17:38:29 UTC (rev 4156)
@@ -563,10 +563,10 @@
def from_python(self, value, state):
if value is None:
return None
- if isinstance(value, (unicode, sqlbuilder.SQLExpression)):
+ if isinstance(value, (str, sqlbuilder.SQLExpression)):
return value
- if isinstance(value, str):
- return unicode(value, self.dbEncoding)
+ if isinstance(value, unicode):
+ return value.encode(self.dbEncoding)
raise validators.Invalid("expected a str or a unicode in the UnicodeCol '%s', got %s %r instead" % \
(self.name, type(value), value), value, state)
|