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

Improved comments

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12159 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7956d3e2
...@@ -221,8 +221,7 @@ class Predicate(Folder): ...@@ -221,8 +221,7 @@ class Predicate(Folder):
membership_select_list = map(lambda l: '( %s )' % ' OR '.join(l), membership_select_list = map(lambda l: '( %s )' % ' OR '.join(l),
membership_dict.values()) membership_dict.values())
# First build SQL for membership criteria # Then build SQL for multimembership_dict criteria
# It would be much nicer if all this was handled by the catalog in a central place
multimembership_dict = {} multimembership_dict = {}
for base_category in self.getMultimembershipCriterionBaseCategoryList(): for base_category in self.getMultimembershipCriterionBaseCategoryList():
multimembership_dict[base_category] = [] # Init dict with valid base categories multimembership_dict[base_category] = [] # Init dict with valid base categories
...@@ -266,6 +265,9 @@ class Predicate(Folder): ...@@ -266,6 +265,9 @@ class Predicate(Folder):
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'):
""" """
A Predicate can be rendered as an SQL expression. This
can be used to generate SQL requests in reports or in
catalog search queries.
""" """
return self.buildSQLQuery(strict_membership=strict_membership, table=table)['where_expression'] return self.buildSQLQuery(strict_membership=strict_membership, table=table)['where_expression']
......
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