From 89a12a50b2532a0c05d148294a1e12026ca642ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com> Date: Tue, 27 Feb 2007 14:59:29 +0000 Subject: [PATCH] define cache factory git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13086 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/ERP5Site.py | 10 +++++----- product/ERP5/Tool/CategoryTool.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py index d52d4b0f57..10bb3ca129 100644 --- a/product/ERP5/ERP5Site.py +++ b/product/ERP5/ERP5Site.py @@ -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'): diff --git a/product/ERP5/Tool/CategoryTool.py b/product/ERP5/Tool/CategoryTool.py index c3576ac1f6..8ab6d8924a 100644 --- a/product/ERP5/Tool/CategoryTool.py +++ b/product/ERP5/Tool/CategoryTool.py @@ -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): -- 2.30.9