Commit 391b2a38 authored by Jean-Paul Smets's avatar Jean-Paul Smets

This adds some compatibility between old naming and new naming. It also fixed...

This adds some compatibility between old naming and new naming. It also fixed asSQLJoinExpression so that domain trees may work again. This fix is a quick hack. The appropriate approach is to refactor the querying mechanism alltogether with queries in the catalog.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12050 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df49fe3c
...@@ -259,20 +259,32 @@ class Predicate(Folder): ...@@ -259,20 +259,32 @@ class Predicate(Folder):
sql_query['from_table_list'] = from_table_dict.items() sql_query['from_table_list'] = from_table_dict.items()
return sql_query return sql_query
# Compatibililty SQL Sql
security.declareProtected( Permissions.AccessContentsInformation, 'buildSqlQuery' )
buildSqlQuery = buildSQLQuery
security.declareProtected( Permissions.AccessContentsInformation, 'asSQLExpression' ) security.declareProtected( Permissions.AccessContentsInformation, 'asSQLExpression' )
def asSQLExpression(self, strict_membership=0, table='category'): def asSQLExpression(self, strict_membership=0, table='category'):
""" """
""" """
return self.buildSQLQuery(strict_membership=strict_membership, table=table)['where_expression'] return self.buildSQLQuery(strict_membership=strict_membership, table=table)['where_expression']
# Compatibililty SQL Sql
security.declareProtected( Permissions.AccessContentsInformation, 'asSqlExpression' )
asSqlExpression = asSQLExpression
security.declareProtected( Permissions.AccessContentsInformation, 'asSQLJoinExpression' ) security.declareProtected( Permissions.AccessContentsInformation, 'asSQLJoinExpression' )
def asSQLJoinExpression(self, strict_membership=0, table='category', join_table='catalog', join_column='uid'): def asSQLJoinExpression(self, strict_membership=0, table='category', join_table='catalog', join_column='uid'):
""" """
""" """
table_list = self.buildSQLQuery(strict_membership=strict_membership, table=table)['from_table_list'] table_list = self.buildSQLQuery(strict_membership=strict_membership, table=table)['from_table_list']
sql_text_list = map(lambda (a,b): '%s AS %s' % (b,a), table_list) sql_text_list = map(lambda (a,b): '%s AS %s' % (b,a), filter(lambda (a,b): a != join_table, table_list))
return ' , '.join(sql_text_list) return ' , '.join(sql_text_list)
# Compatibililty SQL Sql
security.declareProtected( Permissions.AccessContentsInformation, 'asSqlJoinExpression' )
asSqlJoinExpression = asSQLJoinExpression
def searchResults(self, **kw): def searchResults(self, **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