Skip to content

Commit 10e7b8e

Browse files
author
Richard Jones
committed
match empty multilinks implemented for metakit
1 parent 5b19eba commit 10e7b8e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

roundup/backends/back_metakit.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.43 2003-03-17 22:03:04 kedder Exp $
1+
# $Id: back_metakit.py,v 1.44 2003-03-26 06:36:11 richard Exp $
22
'''
33
Metakit backend for Roundup, originally by Gordon McMillan.
44
@@ -908,7 +908,9 @@ def filter(self, search_matches, filterspec, sort=(None,None),
908908
if prop is None:
909909
prop = self.privateprops[propname]
910910
if isinstance(prop, hyperdb.Multilink):
911-
if type(value) is not _LISTTYPE:
911+
if value in ('-1', ['-1']):
912+
value = []
913+
elif type(value) is not _LISTTYPE:
912914
value = [value]
913915
# transform keys to ids
914916
u = []
@@ -987,6 +989,8 @@ def filter(self, search_matches, filterspec, sort=(None,None),
987989
def ff(row, ml=mlcriteria):
988990
for propname, values in ml.items():
989991
sv = getattr(row, propname)
992+
if not values and sv:
993+
return 0
990994
for id in values:
991995
if sv.find(fid=id) == -1:
992996
return 0

0 commit comments

Comments
 (0)