Commit 9961a75f authored by Nicolas Dumazet's avatar Nicolas Dumazet

declare a registry for mixins and documents as ERP5Type.Document will soon

disappear, and qs we'll need to access classes from anywhere in the code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38641 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d7d6f603
......@@ -161,6 +161,22 @@ class TypesTool(TypeProvider):
return None
return getattr(self, portal_type, None)
security.declareProtected(Permissions.AccessContentsInformation, 'getDocumentTypeList')
def getDocumentTypeList(self):
"""
Return a list of Document types that can be used as Base classes
"""
from Products.ERP5Type import document_class_registry
return sorted(document_class_registry)
security.declareProtected(Permissions.AccessContentsInformation, 'getMixinTypeList')
def getMixinTypeList(self):
"""
Return a list of classes names that can be used as Mixins
"""
from Products.ERP5Type import mixin_class_registry
return sorted(mixin_class_registry)
security.declareProtected(Permissions.AddPortalContent, 'listDefaultTypeInformation')
def listDefaultTypeInformation(self):
# FIXME: This method is only used by manage_addTypeInformation below, and
......
......@@ -33,6 +33,13 @@
from zLOG import LOG, INFO
DISPLAY_BOOT_PROCESS = False
# This is used to register all Document classes used in ERP5
# items are class names, values are class paths, e.g.:
# 'Person' -> 'Products.ERP5.Document.Person.Person'
document_class_registry = {}
# similarly for mixins
mixin_class_registry = {}
# Switch(es) for ongoing development which require single code base
# Update ERP5 Globals
......
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