Commit 1c1c32f2 authored by Aurel's avatar Aurel

add compatibility with spec parameter from BTreeFolder2


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16279 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c95771ce
...@@ -437,13 +437,13 @@ class HBTreeFolder2Base (Persistent): ...@@ -437,13 +437,13 @@ class HBTreeFolder2Base (Persistent):
security.declareProtected(access_contents_information, security.declareProtected(access_contents_information,
'ObjectValues') 'ObjectValues')
def objectValues(self, base_id=None): def objectValues(self, base_id=None, spec=None):
return LazyMap(self._getOb, self.objectIds(base_id)) return LazyMap(self._getOb, self.objectIds(base_id))
security.declareProtected(access_contents_information, security.declareProtected(access_contents_information,
'objectIds') 'objectIds')
def objectIds(self, base_id=None): def objectIds(self, base_id=None, spec=None):
if base_id is None: if base_id is None:
return LazyCat(LazyMap(self._treeObjectIds, self.getTreeIdList())) return LazyCat(LazyMap(self._treeObjectIds, self.getTreeIdList()))
else: else:
...@@ -452,12 +452,12 @@ class HBTreeFolder2Base (Persistent): ...@@ -452,12 +452,12 @@ class HBTreeFolder2Base (Persistent):
security.declareProtected(access_contents_information, security.declareProtected(access_contents_information,
'objectItems') 'objectItems')
def objectItems(self, spec=None): def objectItems(self, base_id=None, spec=None):
# Returns a list of (id, subobject) tuples of the current object. # Returns a list of (id, subobject) tuples of the current object.
# If 'spec' is specified, returns only objects whose meta_type match # If 'spec' is specified, returns only objects whose meta_type match
# 'spec' # 'spec'
return LazyMap(lambda id, _getOb=self._getOb: (id, _getOb(id)), return LazyMap(lambda id, _getOb=self._getOb: (id, _getOb(id)),
self.objectIds(spec)) self.objectIds(base_id, spec))
security.declareProtected(access_contents_information, security.declareProtected(access_contents_information,
......
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