[SQL-CVS] r3159 - in SQLObject/branches/0.8: docs sqlobject/sqlite
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2007-11-27 18:14:59
|
Author: phd Date: 2007-11-27 11:14:56 -0700 (Tue, 27 Nov 2007) New Revision: 3159 Modified: SQLObject/branches/0.8/docs/News.txt SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py Log: With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs. Modified: SQLObject/branches/0.8/docs/News.txt =================================================================== --- SQLObject/branches/0.8/docs/News.txt 2007-11-27 18:13:38 UTC (rev 3158) +++ SQLObject/branches/0.8/docs/News.txt 2007-11-27 18:14:56 UTC (rev 3159) @@ -7,6 +7,11 @@ .. _start: +SQLObject 0.8.7 +=============== + +* A number of changes ported from `SQLObject 0.7.10`_. + SQLObject 0.8.6 =============== @@ -189,6 +194,12 @@ * Fixed aggregators and accumulators with inheritance. +SQLObject 0.7.10 +================ + +* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use + base64 for BLOBs. + SQLObject 0.7.9 =============== Modified: SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py =================================================================== --- SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:13:38 UTC (rev 3158) +++ SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:14:56 UTC (rev 3159) @@ -1,3 +1,4 @@ +import base64 from sqlobject.dbconnection import DBAPI from sqlobject.col import popKey from sqlobject.dberrors import * @@ -35,6 +36,9 @@ except ImportError: import sqlite using_sqlite2 = False + if using_sqlite2: + sqlite.encode = base64.encodestring + sqlite.decode = base64.decodestring self.module = sqlite self.filename = filename # full path to sqlite-db-file self._memory = filename == ':memory:' @@ -54,15 +58,6 @@ 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: - import base64 - sqlite.encode = base64.encodestring - sqlite.decode = base64.decodestring - else: - sqlite.encode = encode - sqlite.decode = decode global sqlite2_Binary if sqlite2_Binary is None: sqlite2_Binary = sqlite.Binary |