Author: phd
Date: 2007-03-02 08:41:20 -0700 (Fri, 02 Mar 2007)
New Revision: 2374
Modified:
SQLObject/branches/0.8/docs/News.txt
SQLObject/branches/0.8/sqlobject/sqlbuilder.py
Log:
Fixed a bug in UnicodeField - allow comparison with None.
Modified: SQLObject/branches/0.8/docs/News.txt
===================================================================
--- SQLObject/branches/0.8/docs/News.txt 2007-03-02 15:40:39 UTC (rev 2373)
+++ SQLObject/branches/0.8/docs/News.txt 2007-03-02 15:41:20 UTC (rev 2374)
@@ -124,6 +124,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.8/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/branches/0.8/sqlobject/sqlbuilder.py 2007-03-02 15:40:39 UTC (rev 2373)
+++ SQLObject/branches/0.8/sqlobject/sqlbuilder.py 2007-03-02 15:41:20 UTC (rev 2374)
@@ -332,10 +332,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)
|