Commit 89a12a50 authored by Aurel's avatar Aurel

define cache factory

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13086 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 83e3de39
......@@ -398,7 +398,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getTypeList = CachingMethod(getTypeList,
id=('_getPortalGroupedTypeList', group),
cache_duration=3600)
cache_factory='erp5_core_medium')
return getTypeList(group)
def _getPortalGroupedCategoryList(self, group):
......@@ -415,7 +415,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getCategoryList = CachingMethod(
getCategoryList,
id=('_getPortalGroupedCategoryList', group),
cache_duration=3600)
cache_factory='erp5_core_medium')
return getCategoryList(group)
def _getPortalGroupedStateList(self, group):
......@@ -433,7 +433,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getStateList = CachingMethod(getStateList,
id=('_getPortalGroupedStateList', group),
cache_duration=3600)
cache_factory='erp5_core_medium')
return getStateList(group)
security.declareProtected(Permissions.AccessContentsInformation,
......@@ -892,7 +892,7 @@ class ERP5Site(FolderMixIn, CMFSite):
if module is None: # we can't access this one
continue
if portal_type in self.portal_types[module.getPortalType()].allowed_content_types:
module_name = mod
module_name = mod
break
if module_name is not None:
return module_name
......@@ -1076,7 +1076,7 @@ class ERP5Generator(PortalGenerator):
addTool('ERP5 Order Tool', None)
if not p.hasObject('portal_tests'):
addTool('ERP5 Test Tool', None)
# Add ERP5Type Tool
addTool = p.manage_addProduct['ERP5Type'].manage_addTool
if not p.hasObject('portal_caches'):
......
......@@ -137,7 +137,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
"""
def getBaseCategoryDict(self):
return dict.fromkeys(self.getBaseCategoryList(), None)
return CachingMethod(getBaseCategoryDict, 'portal_categories.getBaseCategoryDict', cache_duration=None)(self)
return CachingMethod(getBaseCategoryDict, 'portal_categories.getBaseCategoryDict', cache_factory='erp5_core_long')(self)
def updateRelatedContent(self, context,
previous_category_url, new_category_url):
......
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