[Erp5-report] r17044 - /erp5/trunk/products/ERP5Type/Interactor.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Oct 18 18:45:58 CEST 2007
Author: jerome
Date: Thu Oct 18 18:45:57 2007
New Revision: 17044
URL: http://svn.erp5.org?rev=17044&view=rev
Log:
install an interactor to reset _aq_dynamic when workflow chain changed
Modified:
erp5/trunk/products/ERP5Type/Interactor.py
Modified: erp5/trunk/products/ERP5Type/Interactor.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Interactor.py?rev=17044&r1=17043&r2=17044&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Interactor.py (original)
+++ erp5/trunk/products/ERP5Type/Interactor.py Thu Oct 18 18:45:57 2007
@@ -93,10 +93,29 @@
return InteractorSource(method)
+class AqDynamicInteractor(Interactor):
+ """This base interactor will reset _aq_dynamic method cache, to regenerate
+ new accessors.
+ """
+ def resetAqDynamic(self, *args, **kw):
+ """
+ Reset _aq_dynamic
+ """
+ _aq_reset()
+
+
+class WorkflowToolInteractor(AqDynamicInteractor):
+ """This interactor reset aq_dynamic method cache whenever workflow
+ associations are changed.
+ """
+ def install(self):
+ from Products.CMFCore.WorkflowTool import WorkflowTool
+ self.on(WorkflowTool.manage_changeWorkflows).doAfter(self.resetAqDynamic)
+
## #
## # Experimental part
## #
-## class AqDynamicInteractor(Interactor):
+## class InteractionWorkflowAqDynamicInteractor(AqDynamicInteractor):
## def install(self):
## """
@@ -112,11 +131,6 @@
## """
## # Interaction example
-## def resetAqDynamic(self, method_call_object, a, b, toto=None):
-## """
-## Reset _aq_dynamic
-## """
-## _aq_reset()
## class TypeInteractorExample(Interactor):
@@ -203,12 +217,15 @@
pass
-#test = AqDynamicInteractor()
-#test.install()
-
-
#interactor_of_interactor = InteractorOfInteractor(test)
#interactor_of_interactor.install()
+
+
+# Install some interactors:
+
+WorkflowToolInteractor().install()
+
# This is used in ERP5Form and install method is called in ERP5Form
# Don't install this interactor here.
fielf_value_interactor = FieldValueInteractor()
+
More information about the Erp5-report
mailing list