[SQL-CVS] r3112 - in SQLObject/trunk/sqlobject: . sqlite
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2007-10-22 10:55:25
|
Author: phd Date: 2007-10-22 04:55:22 -0600 (Mon, 22 Oct 2007) New Revision: 3112 Modified: SQLObject/trunk/sqlobject/col.py SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py Log: Changed the implementation type in BoolCol under SQLite from TINYINT to BOOLEAN and made fromDatabase machinery to recognize it. Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2007-10-22 10:47:08 UTC (rev 3111) +++ SQLObject/trunk/sqlobject/col.py 2007-10-22 10:55:22 UTC (rev 3112) @@ -691,7 +691,7 @@ return "BOOLEAN" def _sqliteType(self): - return "TINYINT" + return "BOOLEAN" class BoolCol(Col): baseClass = SOBoolCol Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py =================================================================== --- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2007-10-22 10:47:08 UTC (rev 3111) +++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2007-10-22 10:55:22 UTC (rev 3112) @@ -346,16 +346,18 @@ def guessClass(self, t): t = t.upper() - if t.find('INT') > 0: + if t.find('INT') >= 0: return col.IntCol, {} - elif t.find('TEXT') > 0 or t.find('CHAR') > 0 or t.find('CLOB') > 0: + elif t.find('TEXT') >= 0 or t.find('CHAR') >= 0 or t.find('CLOB') >= 0: return col.StringCol, {'length': 2**32-1} - elif t.find('BLOB') > 0: + elif t.find('BLOB') >= 0: return col.BLOBCol, {"length": 2**32-1} - elif t.find('REAL') > 0 or t.find('FLOAT') > 0: + elif t.find('REAL') >= 0 or t.find('FLOAT') >= 0: return col.FloatCol, {} - elif t.find('DECIMAL') > 0: + elif t.find('DECIMAL') >= 0: return col.DecimalCol, {} + elif t.find('BOOL') >= 0: + return col.DecimalCol, {} else: return col.Col, {} |