add 'any' operator

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3983 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-09-08 13:30:16 +00:00
parent 062ff7e851
commit 9609ca6d22

View file

@ -187,7 +187,13 @@ def checkOnly(value, compValue):
def checkIn(value, compValue):
return value in compValue
operators = {'only': checkOnly, 'in': checkIn}
def checkAny(value, compValue):
for v in value:
if v in compValue:
return True
return False
operators = {'any': checkAny, 'in': checkIn, 'only': checkOnly}
class CompoundQueryCriteria(BaseQueryCriteria, Compound):