Ejemplo n.º 1
0
document_class_registry = {}
# similarly for mixins
mixin_class_registry = {}

# For early phases of bootstrap (and future ZODB property sheets)
# ERP5Type.PropertySheet becomes a dynamic module that always
# returns a string. ERP5Type.PropertySheet.doesnotexist for example
# is 'doesnotexist'
# Later on, if a local property sheet is imported from a product,
# importLocalPropertySheet will load it as ERP5Type.PropertySheet.*
# This is mostly a backwards compatible mechanism, to ensure that
# old class definitions will still work with properties such as
#    property_sheets = (ERP5Type.PropertySheet.YYY, ... )
# after transforming 'YYY' into a ZODB property sheet
from dynamic.dynamic_module import registerDynamicModule
PropertySheet = registerDynamicModule('Products.ERP5Type.PropertySheet',
                                      lambda name: name)

# Switch(es) for ongoing development which require single code base

# Update ERP5 Globals
import sys, Permissions, os
from App.Common import package_home
this_module = sys.modules[ __name__ ]
product_path = package_home( globals() )
this_module._dtmldir = os.path.join( product_path, 'dtml' )
from Products.ERP5Type.Utils import initializeProduct, updateGlobals
document_classes = updateGlobals( this_module,
                                  globals(),
                                  permissions_module=Permissions,
                                  is_erp5_type=1 )
Ejemplo n.º 2
0
document_class_registry = {}
# similarly for mixins
mixin_class_registry = {}

# For early phases of bootstrap (and future ZODB property sheets)
# ERP5Type.PropertySheet becomes a dynamic module that always
# returns a string. ERP5Type.PropertySheet.doesnotexist for example
# is 'doesnotexist'
# Later on, if a local property sheet is imported from a product,
# importLocalPropertySheet will load it as ERP5Type.PropertySheet.*
# This is mostly a backwards compatible mechanism, to ensure that
# old class definitions will still work with properties such as
#    property_sheets = (ERP5Type.PropertySheet.YYY, ... )
# after transforming 'YYY' into a ZODB property sheet
from dynamic.dynamic_module import registerDynamicModule
PropertySheet = registerDynamicModule('Products.ERP5Type.PropertySheet',
                                      lambda name: name)

# Switch(es) for ongoing development which require single code base

# Update ERP5 Globals
import sys, Permissions, os
from App.Common import package_home
this_module = sys.modules[__name__]
product_path = package_home(globals())
this_module._dtmldir = os.path.join(product_path, 'dtml')
from Products.ERP5Type.Utils import initializeProduct, updateGlobals
document_classes = updateGlobals(this_module,
                                 globals(),
                                 permissions_module=Permissions,
                                 is_erp5_type=1)