Author: phd
Date: 2006-10-11 14:02:00 -0600 (Wed, 11 Oct 2006)
New Revision: 2010
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/sqlite/sqliteconnection.py
Log:
Stop PySQLite2 converting date/time columns - the conversion causes troubles,
and our conversion is more flexible.
Modified: SQLObject/branches/0.7-bugfix/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/sqlite/sqliteconnection.py 2006-10-11 14:45:43 UTC (rev 2009)
+++ SQLObject/branches/0.7-bugfix/sqlobject/sqlite/sqliteconnection.py 2006-10-11 20:02:00 UTC (rev 2010)
@@ -38,9 +38,9 @@
import warnings
warnings.warn(DeprecationWarning("pysqlite2 does not support the encoding option"))
opts["detect_types"] = sqlite.PARSE_DECLTYPES
- for col_type in "text", "char", "varchar":
- sqlite.register_converter(col_type, stop_pysqlite2_converting_strings_to_unicode)
- sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings_to_unicode)
+ for col_type in "text", "char", "varchar", "date", "time", "datetime", "timestamp":
+ sqlite.register_converter(col_type, stop_pysqlite2_converting_strings)
+ sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings)
try:
from sqlite import encode, decode
except ImportError:
@@ -213,5 +213,5 @@
def delColumn(self, tableName, column):
pass # Oops! There is no DROP COLUMN in SQLite
-def stop_pysqlite2_converting_strings_to_unicode(s):
+def stop_pysqlite2_converting_strings(s):
return s
|