Commit 0a8a2665 authored by Vincent Pelletier's avatar Vincent Pelletier

Products.ZSQLCatalog: Expose query base class to restricted Python

For type checking (not recommended, but sometimes useful).
Expose it as BaseQuery, to avoid conflict with AutoQuery original name.
parent d35b95ef
...@@ -2211,7 +2211,7 @@ class Catalog(Folder, ...@@ -2211,7 +2211,7 @@ class Catalog(Folder,
# as "RawKey" # as "RawKey"
elif search_key_name == 'ExactMatch': elif search_key_name == 'ExactMatch':
search_key_name = value['key'] = 'RawKey' search_key_name = value['key'] = 'RawKey'
if isinstance(value, _Query): if isinstance(value, BaseQuery):
# Query instance: use as such, ignore key. # Query instance: use as such, ignore key.
result = value result = value
elif script is not None: elif script is not None:
...@@ -2720,7 +2720,7 @@ InitializeClass(Catalog) ...@@ -2720,7 +2720,7 @@ InitializeClass(Catalog)
class CatalogError(Exception): pass class CatalogError(Exception): pass
from Query.Query import Query as _Query from Query.Query import Query as BaseQuery
from Query.SimpleQuery import SimpleQuery from Query.SimpleQuery import SimpleQuery
from Query.ComplexQuery import ComplexQuery from Query.ComplexQuery import ComplexQuery
from Query.AutoQuery import AutoQuery from Query.AutoQuery import AutoQuery
......
...@@ -38,7 +38,7 @@ def initialize(context): ...@@ -38,7 +38,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', 'AndQuery', 'OrQuery', 'ComplexQuery', 'Query', 'NegatedQuery', 'AndQuery', 'OrQuery',
'SQLQuery') 'BaseQuery', 'SQLQuery')
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