Commit a3c88693 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added placeholder for scriptable keys

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12986 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0632686f
...@@ -310,7 +310,6 @@ class Query(QueryMixin): ...@@ -310,7 +310,6 @@ class Query(QueryMixin):
else: else:
where_expression.append("%s = %s" % (key, self._quoteSQLString(value))) where_expression.append("%s = %s" % (key, self._quoteSQLString(value)))
if len(where_expression)>0: if len(where_expression)>0:
if len(where_expression)==1: if len(where_expression)==1:
where_expression = where_expression[0] where_expression = where_expression[0]
...@@ -339,7 +338,7 @@ class ComplexQuery(QueryMixin): ...@@ -339,7 +338,7 @@ class ComplexQuery(QueryMixin):
""" """
Used in order to concatenate many queries Used in order to concatenate many queries
""" """
def __init__(self,*args,**kw): def __init__(self, *args, **kw):
self.query_list = args self.query_list = args
operator = None operator = None
if kw.has_key('operator'): if kw.has_key('operator'):
...@@ -347,7 +346,7 @@ class ComplexQuery(QueryMixin): ...@@ -347,7 +346,7 @@ class ComplexQuery(QueryMixin):
del kw['operator'] del kw['operator']
if operator is None: if operator is None:
operator = 'AND' operator = 'AND'
self.operator=operator self.operator = operator
self.__dict__.update(kw) self.__dict__.update(kw)
def __call__(self): def __call__(self):
...@@ -356,7 +355,7 @@ class ComplexQuery(QueryMixin): ...@@ -356,7 +355,7 @@ class ComplexQuery(QueryMixin):
def getQueryList(self): def getQueryList(self):
return self.query_list return self.query_list
def asSQLExpression(self,key_alias_dict=None, def asSQLExpression(self, key_alias_dict=None,
ignore_empty_string=1, ignore_empty_string=1,
keyword_search_keys=None, keyword_search_keys=None,
full_text_search_keys=None, full_text_search_keys=None,
...@@ -641,6 +640,11 @@ class Catalog( Folder, ...@@ -641,6 +640,11 @@ class Catalog( Folder,
'description' : 'Additional columns obtained through joins', 'description' : 'Additional columns obtained through joins',
'type' : 'lines', 'type' : 'lines',
'mode' : 'w' }, 'mode' : 'w' },
{ 'id' : 'sql_catalog_scriptable_keys',
'title' : 'Related keys',
'description' : 'Virtual columns to generate scriptable scriptable queries',
'type' : 'lines',
'mode' : 'w' },
) )
sql_catalog_produce_reserved = '' sql_catalog_produce_reserved = ''
...@@ -672,6 +676,7 @@ class Catalog( Folder, ...@@ -672,6 +676,7 @@ class Catalog( Folder,
sql_catalog_topic_search_keys = () sql_catalog_topic_search_keys = ()
sql_catalog_multivalue_keys = () sql_catalog_multivalue_keys = ()
sql_catalog_related_keys = () sql_catalog_related_keys = ()
sql_catalog_scriptable_keys = ()
# These are ZODB variables, so shared by multiple Zope instances. # These are ZODB variables, so shared by multiple Zope instances.
# This is set to the last logical time when clearReserved is called. # This is set to the last logical time when clearReserved is called.
...@@ -1665,7 +1670,7 @@ class Catalog( Folder, ...@@ -1665,7 +1670,7 @@ class Catalog( Folder,
getSqlCatalogRelatedKeyList = getSQLCatalogRelatedKeyList getSqlCatalogRelatedKeyList = getSQLCatalogRelatedKeyList
def buildSQLQuery(self, query_table='catalog', REQUEST=None, def buildSQLQuery(self, query_table='catalog', REQUEST=None,
ignore_empty_string=1, query=None,stat__=0,**kw): ignore_empty_string=1, query=None, stat__=0, **kw):
""" Builds a complex SQL query to simulate ZCalatog behaviour """ """ Builds a complex SQL query to simulate ZCalatog behaviour """
# Get search arguments: # Get search arguments:
if REQUEST is None and (kw is None or kw == {}): if REQUEST is None and (kw is None or kw == {}):
......
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