Commit 93189352 authored by Jérome Perrin's avatar Jérome Perrin

synchronize ERP5Site.searchFolder implementation with ERP5Type.Core.Folder.searchFolder


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18234 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 40f26392
...@@ -339,17 +339,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -339,17 +339,7 @@ class ERP5Site(FolderMixIn, CMFSite):
""" """
if not kw.has_key('parent_uid'): if not kw.has_key('parent_uid'):
kw['parent_uid'] = self.uid kw['parent_uid'] = self.uid
kw2 = {} return self.portal_catalog.searchResults(**kw)
# Remove useless matter before calling the
# catalog. In particular, consider empty
# strings as None values
for cname in kw.keys():
if kw[cname] not in ('', None):
kw2[cname] = kw[cname]
# The method to call to search the folder
# content has to be called z_search_folder
method = self.portal_catalog.searchResults
return method(**kw2)
security.declareProtected(Permissions.AccessContentsInformation, 'countFolder') security.declareProtected(Permissions.AccessContentsInformation, 'countFolder')
def countFolder(self, **kw): def countFolder(self, **kw):
...@@ -359,17 +349,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -359,17 +349,7 @@ class ERP5Site(FolderMixIn, CMFSite):
""" """
if not kw.has_key('parent_uid'): if not kw.has_key('parent_uid'):
kw['parent_uid'] = self.uid kw['parent_uid'] = self.uid
kw2 = {} return self.portal_catalog.countResults(**kw)
# Remove useless matter before calling the
# catalog. In particular, consider empty
# strings as None values
for cname in kw.keys():
if kw[cname] not in ('', None):
kw2[cname] = kw[cname]
# The method to call to search the folder
# content has to be called z_search_folder
method = self.portal_catalog.countResults
return method(**kw2)
# Proxy methods for security reasons # Proxy methods for security reasons
def getOwnerInfo(self): def getOwnerInfo(self):
......
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