Commit 6dcd000a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

implement InteractorSource.doBefore().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36748 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a5c804a7
...@@ -101,11 +101,23 @@ class InteractorSource: ...@@ -101,11 +101,23 @@ class InteractorSource:
""" """
self.method = method self.method = method
def doAfter(self, action, *args, **kw): def doBefore(self, action, *args, **kw):
""" """
""" """
if not isinstance(self.method, InteractorMethod):
im_class = self.method.im_class im_class = self.method.im_class
# Turn this into an InteractorMethod
interactor_method = InteractorMethod(self.method)
setattr(im_class, self.method.__name__, interactor_method)
self.method = interactor_method
# Register the action
self.method.registerBeforeAction(action, args, kw)
def doAfter(self, action, *args, **kw):
"""
"""
if not isinstance(self.method, InteractorMethod): if not isinstance(self.method, InteractorMethod):
im_class = self.method.im_class
# Turn this into an InteractorMethod # Turn this into an InteractorMethod
interactor_method = InteractorMethod(self.method) interactor_method = InteractorMethod(self.method)
setattr(im_class, self.method.__name__, interactor_method) setattr(im_class, self.method.__name__, interactor_method)
......
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