Commit 821515ff authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add an option "recursive" into initializeDynamicProperties, because self should not be None.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1837 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2b76f25e
......@@ -71,19 +71,19 @@ from zLOG import LOG, INFO, ERROR, WARNING
# Dynamic method acquisition system (code generation)
aq_method_generated = {}
def initializeDynamicProperties(self, klass):
def initializeDynamicProperties(self, klass, recursive=0):
id = ''
#LOG('before aq_method_generated %s' % id, 0, str(klass.__name__))
if not aq_method_generated.has_key(klass):
aq_method_generated[klass] = 1
# Recurse to superclasses
for super_klass in klass.__bases__:
if getattr(super_klass, 'isRADContent', 0): initializeDynamicProperties(None, super_klass)
if getattr(super_klass, 'isRADContent', 0): initializeDynamicProperties(self, super_klass, recursive=1)
# Initialize default properties
#LOG('in aq_method_generated %s' % id, 0, str(klass.__name__))
from Utils import initializeDefaultProperties
initializeDefaultProperties([klass])
if self is not None:
initializeDefaultProperties([klass], object=self)
if not recursive:
# We should now make sure workflow methods are defined
# and also make sure simulation state is defined
portal_workflow = getToolByName(self, 'portal_workflow')
......
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