diff roundup/backends/rdbms_common.py @ 2495:8ff455218ec2 maint-0.7

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Wed, 23 Jun 2004 23:21:32 +0000
parents a15f91a10e45
children 4d112730e02f
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Wed Jun 23 22:59:17 2004 +0000
+++ b/roundup/backends/rdbms_common.py	Wed Jun 23 23:21:32 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.98.2.9 2004-06-21 04:34:57 richard Exp $
+# $Id: rdbms_common.py,v 1.98.2.10 2004-06-23 23:21:32 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1945,8 +1945,14 @@
             elif values is None:
                 where.append('_%s is NULL'%prop)
             else:
-                allvalues += tuple(values.keys())
-                where.append('_%s in (%s)'%(prop, ','.join([a]*len(values))))
+                values = values.keys()
+                s = ''
+                if None in values:
+                    values.remove(None)
+                    s = '_%s is NULL or '%prop
+                allvalues += tuple(values)
+                s += '_%s in (%s)'%(prop, ','.join([a]*len(values)))
+                where.append(s)
         tables = ['_%s'%self.classname]
         if where:
             o.append('(' + ' and '.join(where) + ')')

Roundup Issue Tracker: http://roundup-tracker.org/