Commit a54722da authored by Yoshinori Okuji's avatar Yoshinori Okuji

Unify invented mode with normal mode.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4107 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 974a81d4
...@@ -177,6 +177,10 @@ class Selection(Acquisition.Implicit, Traversable, Persistent): ...@@ -177,6 +177,10 @@ class Selection(Acquisition.Implicit, Traversable, Persistent):
#LOG("Selection", 0, str(method)) #LOG("Selection", 0, str(method))
#LOG('Selection', 0, "self.invert_mode = %s" % repr(self.invert_mode)) #LOG('Selection', 0, "self.invert_mode = %s" % repr(self.invert_mode))
if self.invert_mode is 0: if self.invert_mode is 0:
kw = self.params
else:
kw = self.params.copy()
kw['uid'] = self.uids
if method is None or type(method) is type('a'): if method is None or type(method) is type('a'):
method_path = method or self.method_path method_path = method or self.method_path
method = context.unrestrictedTraverse(method_path) method = context.unrestrictedTraverse(method_path)
...@@ -194,21 +198,18 @@ class Selection(Acquisition.Implicit, Traversable, Persistent): ...@@ -194,21 +198,18 @@ class Selection(Acquisition.Implicit, Traversable, Persistent):
#LOG('Selection', 0, "self.params = %s" % repr(self.params)) #LOG('Selection', 0, "self.params = %s" % repr(self.params))
if self.domain is not None and self.report is not None: if self.domain is not None and self.report is not None:
result = method(selection_domain = self.domain, result = method(selection_domain = self.domain,
selection_report = self.report, selection=self, **self.params) selection_report = self.report, selection=self, **kw)
elif self.domain is not None: elif self.domain is not None:
result = method(selection_domain = self.domain, selection=self, **self.params) result = method(selection_domain = self.domain, selection=self, **kw)
elif self.report is not None: elif self.report is not None:
result = method(selection_report = self.report, selection=self, **self.params) result = method(selection_report = self.report, selection=self, **kw)
else: else:
result = method(selection=self, **self.params) result = method(selection=self, **kw)
return result return result
else: else:
return [] return []
else: else:
return [] return []
else:
# We sould try to allow more filtering
return context.portal_catalog(uid = self.uids, **self.params)
def __getitem__(self, index, REQUEST=None): def __getitem__(self, index, REQUEST=None):
return self(REQUEST)[index] return self(REQUEST)[index]
......
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