Commit 211a4dab authored by Jérome Perrin's avatar Jérome Perrin

http://svn.erp5.org/?rev=11868&view=rev

Naming convention: SQL should be in big caps.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11950 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9d8ccb42
......@@ -726,18 +726,18 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
getObjectIds = CMFBTreeFolder.objectIds
# Overloading
security.declareProtected( Permissions.AccessContentsInformation, 'getParentSqlExpression' )
def getParentSqlExpression(self, table = 'catalog', strict_membership = 0):
security.declareProtected( Permissions.AccessContentsInformation, 'getParentSQLExpression' )
def getParentSQLExpression(self, table = 'catalog', strict_membership = 0):
"""
Builds an SQL expression to search children and subclidren
"""
if strict_membership:
return Base.getParentSqlExpression(self, table=table, strict_membership=strict_membership)
return Base.getParentSQLExpression(self, table=table, strict_membership=strict_membership)
result = "%s.parent_uid = %s" % (table, self.getUid())
for o in self.objectValues():
if hasattr(aq_base(o), 'objectValues'):
# Do not consider non folder objects
result = "%s OR %s" % (result, o.getParentSqlExpression(table=table, strict_membership=strict_membership))
result = "%s OR %s" % (result, o.getParentSQLExpression(table=table, strict_membership=strict_membership))
return "( %s )" % result
......
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