Commit 51cb1cd0 authored by Nicolas Dumazet's avatar Nicolas Dumazet

compatibility getter for portal types as classes:

factory_method_id will disappear, and type_class will
be used instead


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38646 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eea3c11e
......@@ -414,6 +414,21 @@ class ERP5TypeInformation(XMLObject,
"""Getter for 'type_property_sheet' property"""
return list(self.property_sheet_list)
security.declareProtected(Permissions.AccessContentsInformation,
'getTypeClass')
def getTypeClass(self):
"""Getter for type_class"""
base = self._baseGetTypeClass()
if base is None:
# backwards compatibility: if the object has no
# new-style type class, use the oldstyle factory attribute
init_script = self.getTypeFactoryMethodId()
if init_script and init_script.startswith('add'):
base = init_script[3:]
# and of course migrate the property
self.setTypeClass(base)
return base
security.declareProtected(Permissions.AccessContentsInformation,
'getTypeBaseCategoryList')
def getTypeBaseCategoryList(self):
......
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