[Erp5-report] r36748 kazuhiko - /erp5/trunk/products/ERP5Type/Interactor/Interactor.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 30 16:40:38 CEST 2010


Author: kazuhiko
Date: Wed Jun 30 16:40:38 2010
New Revision: 36748

URL: http://svn.erp5.org?rev=36748&view=rev
Log:
implement InteractorSource.doBefore().

Modified:
    erp5/trunk/products/ERP5Type/Interactor/Interactor.py

Modified: erp5/trunk/products/ERP5Type/Interactor/Interactor.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Interactor/Interactor.py?rev=36748&r1=36747&r2=36748&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Interactor/Interactor.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Interactor/Interactor.py [utf8] Wed Jun 30 16:40:38 2010
@@ -101,11 +101,23 @@ class InteractorSource:
     """
     self.method = method
 
+  def doBefore(self, action, *args, **kw):
+    """
+    """
+    if not isinstance(self.method, InteractorMethod):
+      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):
     """
     """
-    im_class = self.method.im_class
     if not isinstance(self.method, InteractorMethod):
+      im_class = self.method.im_class
       # Turn this into an InteractorMethod
       interactor_method = InteractorMethod(self.method)
       setattr(im_class, self.method.__name__, interactor_method)




More information about the Erp5-report mailing list