Commit 62a23f01 authored by Jérome Perrin's avatar Jérome Perrin

install an interactor to reset _aq_dynamic when workflow chain changed



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17044 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 60dc1d2a
...@@ -93,10 +93,29 @@ class Interactor: ...@@ -93,10 +93,29 @@ class Interactor:
return InteractorSource(method) 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 ## # Experimental part
## # ## #
## class AqDynamicInteractor(Interactor): ## class InteractionWorkflowAqDynamicInteractor(AqDynamicInteractor):
## def install(self): ## def install(self):
## """ ## """
...@@ -112,11 +131,6 @@ class Interactor: ...@@ -112,11 +131,6 @@ class Interactor:
## """ ## """
## # Interaction example ## # Interaction example
## def resetAqDynamic(self, method_call_object, a, b, toto=None):
## """
## Reset _aq_dynamic
## """
## _aq_reset()
## class TypeInteractorExample(Interactor): ## class TypeInteractorExample(Interactor):
...@@ -203,12 +217,15 @@ class InteractorOfInteractor(Interactor): ...@@ -203,12 +217,15 @@ class InteractorOfInteractor(Interactor):
pass pass
#test = AqDynamicInteractor()
#test.install()
#interactor_of_interactor = InteractorOfInteractor(test) #interactor_of_interactor = InteractorOfInteractor(test)
#interactor_of_interactor.install() #interactor_of_interactor.install()
# Install some interactors:
WorkflowToolInteractor().install()
# This is used in ERP5Form and install method is called in ERP5Form # This is used in ERP5Form and install method is called in ERP5Form
# Don't install this interactor here. # Don't install this interactor here.
fielf_value_interactor = FieldValueInteractor() fielf_value_interactor = FieldValueInteractor()
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