Skip to content

Commit 92a4b19

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent cddede7 commit 92a4b19

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Fixed:
1414
- include "context" always, as documented (sf bug 965447)
1515
- fixed REMOTE_USER (external HTTP Basic auth) (sf bug 977309)
1616
- fixed roundup-admin "find" to use better value parsing
17+
- fixed RDBMS Class.find() to handle None value in multiple find
1718

1819

1920
2004-06-10 0.7.4

roundup/backends/rdbms_common.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.9 2004-06-21 04:34:57 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.10 2004-06-23 23:21:32 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1945,8 +1945,14 @@ def find(self, **propspec):
19451945
elif values is None:
19461946
where.append('_%s is NULL'%prop)
19471947
else:
1948-
allvalues += tuple(values.keys())
1949-
where.append('_%s in (%s)'%(prop, ','.join([a]*len(values))))
1948+
values = values.keys()
1949+
s = ''
1950+
if None in values:
1951+
values.remove(None)
1952+
s = '_%s is NULL or '%prop
1953+
allvalues += tuple(values)
1954+
s += '_%s in (%s)'%(prop, ','.join([a]*len(values)))
1955+
where.append(s)
19501956
tables = ['_%s'%self.classname]
19511957
if where:
19521958
o.append('(' + ' and '.join(where) + ')')

test/db_test_base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: db_test_base.py,v 1.27.2.5 2004-06-21 04:34:58 richard Exp $
18+
# $Id: db_test_base.py,v 1.27.2.6 2004-06-23 23:21:32 richard Exp $
1919

2020
import unittest, os, shutil, errno, imp, sys, time, pprint
2121

@@ -757,6 +757,13 @@ def testFindLinkUnset(self):
757757
got.sort()
758758
self.assertEqual(got, [one, three])
759759

760+
def testFindMultipleLink(self):
761+
one, two, three, four = self._find_test_setup()
762+
self.assertEqual(self.db.issue.find(status={'1':1, '3':1}),
763+
[one, three, four])
764+
self.assertEqual(self.db.issue.find(assignedto={None:1, '1':1}),
765+
[one, three, four])
766+
760767
def testFindMultilink(self):
761768
one, two, three, four = self._find_test_setup()
762769
got = self.db.issue.find(nosy='2')

0 commit comments

Comments
 (0)