Add object type filtering to iter_resources
This commit is contained in:
parent
63da39e005
commit
bfb3689456
16 changed files with 92 additions and 61 deletions
|
|
@ -74,11 +74,12 @@ class Transfer(CapBaseObject):
|
|||
self.add_field('recipient', (int, long, basestring))
|
||||
|
||||
class ICapBank(ICapCollection):
|
||||
def iter_resources(self, split_path):
|
||||
if len(split_path) > 0:
|
||||
raise CollectionNotFound(split_path)
|
||||
def iter_resources(self, objs, split_path):
|
||||
if Account in objs:
|
||||
if len(split_path) > 0:
|
||||
raise CollectionNotFound(split_path)
|
||||
|
||||
return self.iter_accounts()
|
||||
return self.iter_accounts()
|
||||
|
||||
def iter_accounts(self):
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class ICapCollection(IBaseCap):
|
|||
lst.append(resource)
|
||||
return lst
|
||||
|
||||
def iter_resources(self, split_path):
|
||||
def iter_resources(self, objs, split_path):
|
||||
"""
|
||||
split_path is a list, either empty (root path) or with one or many
|
||||
components.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue