[SQL-CVS] r2375 - SQLObject/trunk/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2007-03-02 15:42:00
|
Author: phd
Date: 2007-03-02 08:41:51 -0700 (Fri, 02 Mar 2007)
New Revision: 2375
Modified:
SQLObject/trunk/sqlobject/sqlbuilder.py
Log:
Fixed a bug in UnicodeField - allow comparison with None.
Modified: SQLObject/trunk/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlbuilder.py 2007-03-02 15:41:20 UTC (rev 2374)
+++ SQLObject/trunk/sqlobject/sqlbuilder.py 2007-03-02 15:41:51 UTC (rev 2375)
@@ -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)
|