Commit 3ad68ad1 authored by Jean-Paul Smets's avatar Jean-Paul Smets

updated document class loading (ERP5TypeRepository now contains modules...

updated document class loading (ERP5TypeRepository now contains modules rathers than document classes)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@482 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6c298f07
...@@ -73,11 +73,11 @@ def generateInitFiles(this_module, global_hook, ...@@ -73,11 +73,11 @@ def generateInitFiles(this_module, global_hook,
# Hide internal implementation # Hide internal implementation
from Products.ERP5Type.InitGenerator import InitializeDocument from Products.ERP5Type.InitGenerator import InitializeDocument
import %s as ERP5%s import %s as ERP5%s
if not hasattr(ERP5TypeDocumentRepository, '_override_%s'): ERP5TypeDocumentRepository.%s = ERP5%s.%s # Never override a local Document class if not hasattr(ERP5TypeDocumentRepository, '_override_%s'): ERP5TypeDocumentRepository.%s = ERP5%s # Never override a local Document class
# Default constructor for %s # Default constructor for %s
# Can be overriden by adding a method add%s in class %s # Can be overriden by adding a method add%s in class %s
def add%s(folder, id, REQUEST=None, **kw): def add%s(folder, id, REQUEST=None, **kw):
o = ERP5TypeDocumentRepository.%s(id) o = ERP5TypeDocumentRepository.%s.%s(id)
folder._setObject(id, o) folder._setObject(id, o)
if kw is not None: o.__of__(folder)._edit(force_update=1, **kw) if kw is not None: o.__of__(folder)._edit(force_update=1, **kw)
# contentCreate already calls reindex 3 times ... # contentCreate already calls reindex 3 times ...
...@@ -85,9 +85,9 @@ def add%s(folder, id, REQUEST=None, **kw): ...@@ -85,9 +85,9 @@ def add%s(folder, id, REQUEST=None, **kw):
if REQUEST is not None: if REQUEST is not None:
REQUEST['RESPONSE'].redirect( 'manage_main' ) REQUEST['RESPONSE'].redirect( 'manage_main' )
InitializeDocument(ERP5TypeDocumentRepository.%s, document_path='%s') InitializeDocument(ERP5TypeDocumentRepository.%s.%s, document_path='%s')
class Temp%s(ERP5TypeDocumentRepository.%s): class Temp%s(ERP5TypeDocumentRepository.%s.%s):
isIndexable = 0 isIndexable = 0
def reindexObject(self, *args, **kw): def reindexObject(self, *args, **kw):
...@@ -113,13 +113,13 @@ from AccessControl import ModuleSecurityInfo ...@@ -113,13 +113,13 @@ from AccessControl import ModuleSecurityInfo
ModuleSecurityInfo('Products.ERP5Type.Document').declarePublic('newTemp%s',) ModuleSecurityInfo('Products.ERP5Type.Document').declarePublic('newTemp%s',)
""" % (module_name, module_name, """ % (module_name, module_name,
module_name, module_name, module_name, module_name, module_name, module_name, module_name,
module_name, module_name,
module_name, module_name, module_name, module_name,
module_name, module_name,
module_name,
module_name, document_path,
module_name, module_name, module_name, module_name,
module_name, module_name, document_path,
module_name, module_name, module_name,
module_name, module_name,
module_name, module_name,
module_name, module_name,
......
...@@ -53,6 +53,8 @@ from zLOG import LOG ...@@ -53,6 +53,8 @@ from zLOG import LOG
##################################################### #####################################################
INITIALIZE_PRODUCT_RAD = 1 # If set to 0, product documents are not initialized INITIALIZE_PRODUCT_RAD = 1 # If set to 0, product documents are not initialized
# this will divide by two memory usage taken by getters and setters
# 0 value is suggested for new ERP5 projetcs
##################################################### #####################################################
# Compatibility - XXX - BAD # Compatibility - XXX - BAD
......
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