Commit b6499ce7 authored by Yusei Tahara's avatar Yusei Tahara

Add logical operator utility functions.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28762 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 14d17212
...@@ -2502,6 +2502,12 @@ from Query.AutoQuery import AutoQuery as Query ...@@ -2502,6 +2502,12 @@ from Query.AutoQuery import AutoQuery as Query
def NegatedQuery(query): def NegatedQuery(query):
return ComplexQuery(query, logical_operator='not') return ComplexQuery(query, logical_operator='not')
def AndQuery(*args):
return ComplexQuery(logical_operator='and', *args)
def OrQuery(*args):
return ComplexQuery(logical_operator='or', *args)
allow_class(SimpleQuery) allow_class(SimpleQuery)
allow_class(ComplexQuery) allow_class(ComplexQuery)
......
...@@ -43,7 +43,7 @@ def initialize(context): ...@@ -43,7 +43,7 @@ def initialize(context):
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
ModuleSecurityInfo('Products.ZSQLCatalog.SQLCatalog').declarePublic( ModuleSecurityInfo('Products.ZSQLCatalog.SQLCatalog').declarePublic(
'ComplexQuery', 'Query', 'NegatedQuery',) 'ComplexQuery', 'Query', 'NegatedQuery', 'AndQuery', 'OrQuery')
from Query import Query, SimpleQuery from Query import Query, SimpleQuery
from SearchKey import SearchKey from SearchKey import SearchKey
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment