From 9522b30bd85336291476604ed9ef65402b7871e0 Mon Sep 17 00:00:00 2001 From: stefan Date: Mon, 16 Feb 2009 22:43:07 +0000 Subject: [PATCH] Fix issue2550505. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4136 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/backends/back_anydbm.py | 4 ++-- roundup/backends/rdbms_common.py | 7 +++---- roundup/hyperdb.py | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index 17dfa78..0005f4d 100644 --- a/roundup/backends/back_anydbm.py +++ b/roundup/backends/back_anydbm.py @@ -1561,7 +1561,7 @@ class Class(hyperdb.Class): "sort" and "group" are (dir, prop) where dir is '+', '-' or None and prop is a prop name or None - "search_matches" is {nodeid: marker} or None + "search_matches" is a sequence type or None The filter must match all properties specificed. If the property value to match is a list: @@ -1721,7 +1721,7 @@ class Class(hyperdb.Class): if search_matches is not None: k = [] for v in matches: - if search_matches.has_key(v[0]): + if v[0] in search_matches: k.append(v) matches = k diff --git a/roundup/backends/rdbms_common.py b/roundup/backends/rdbms_common.py index 4b3b480..b5ce677 100644 --- a/roundup/backends/rdbms_common.py +++ b/roundup/backends/rdbms_common.py @@ -2114,7 +2114,7 @@ class Class(hyperdb.Class): backward-compatibility reasons a single (dir, prop) tuple is also allowed. - "search_matches" is {nodeid: marker} or None + "search_matches" is a sequence type or None The filter must match all properties specificed. If the property value to match is a list: @@ -2123,7 +2123,7 @@ class Class(hyperdb.Class): 2. Other properties must match any of the elements in the list. """ # we can't match anything if search_matches is empty - if search_matches == {}: + if not search_matches and search_matches is not None: return [] if __debug__: @@ -2334,8 +2334,7 @@ class Class(hyperdb.Class): # add results of full text search if search_matches is not None: - v = search_matches.keys() - s = ','.join([a for x in v]) + s = ','.join([a for x in search_matches]) where.append('_%s.id in (%s)'%(icn, s)) args = args + v diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index 637543c..b504061 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -707,7 +707,7 @@ All methods except __repr__ must be implemented by a concrete backend Database. raise NotImplementedError def getfile(self, classname, nodeid, property): - '''Store the content of the file in the database. + '''Get the content of the file in the database. ''' raise NotImplementedError @@ -1129,7 +1129,7 @@ class Class: backward-compatibility reasons a single (dir, prop) tuple is also allowed. - "search_matches" is {nodeid: marker} + "search_matches" is a sequence type The filter must match all properties specificed. If the property value to match is a list: -- 2.30.2