Author: phd
Date: 2007-03-02 08:40:39 -0700 (Fri, 02 Mar 2007)
New Revision: 2373
Modified:
SQLObject/branches/0.7/docs/News.txt
SQLObject/branches/0.7/sqlobject/sqlbuilder.py
Log:
Fixed a bug in UnicodeField - allow comparison with None.
Modified: SQLObject/branches/0.7/docs/News.txt
===================================================================
--- SQLObject/branches/0.7/docs/News.txt 2007-03-02 15:30:37 UTC (rev 2372)
+++ SQLObject/branches/0.7/docs/News.txt 2007-03-02 15:40:39 UTC (rev 2373)
@@ -16,6 +16,8 @@
* Another round of changes to create/drop the tables in the right order
in the command-line client `sqlobject-admin`.
+* Fixed a bug in UnicodeField - allow comparison with None.
+
SQLObject 0.7.3
===============
Modified: SQLObject/branches/0.7/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/sqlbuilder.py 2007-03-02 15:30:37 UTC (rev 2372)
+++ SQLObject/branches/0.7/sqlobject/sqlbuilder.py 2007-03-02 15:40:39 UTC (rev 2373)
@@ -329,10 +329,14 @@
SQLObjectField.__init__(self, tableName, fieldName, original)
self.column = column
def __eq__(self, other):
+ if other is None:
+ return ISNULL(self)
if isinstance(other, unicode):
other = other.encode(self.column.dbEncoding)
return SQLOp('=', self, other)
def __ne__(self, other):
+ if other is None:
+ return ISNOTNULL(self)
if isinstance(other, unicode):
other = other.encode(self.column.dbEncoding)
return SQLOp('<>', self, other)
|