Commit 9a88787e authored by Jim Fulton's avatar Jim Fulton

Added logic to create a custom FactoryDispatcher class for a

Python-based product so that factory methods provided by the product
are treated as true methods and have meta data (security info).
parent 7de67ba6
......@@ -88,6 +88,7 @@ from AccessControl.PermissionRole import PermissionRole
import Globals, os, OFS.ObjectManager, OFS.misc_, Products, OFS.PropertySheets
from HelpSys import HelpTopic, APIHelpTopic
from HelpSys.HelpSys import ProductHelp
from FactoryDispatcher import FactoryDispatcher
import string, os.path
import stat
from DateTime import DateTime
......@@ -199,7 +200,14 @@ class ProductContext:
if type(initial) is tt: name, initial = initial
else: name=initial.__name__
if not hasattr(pack, '_m'): pack._m={}
fd=getattr(pack, '__FactoryDispatcher__', None)
if fd is None:
class __FactoryDispatcher__(FactoryDispatcher):
"Factory Dispatcher for a Specific Product"
fd = pack.__FactoryDispatcher__ = __FactoryDispatcher__
if not hasattr(pack, '_m'): pack._m=fd.__dict__
m=pack._m
Products.meta_types=Products.meta_types+(
......
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