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): ...@@ -398,7 +398,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getTypeList = CachingMethod(getTypeList, getTypeList = CachingMethod(getTypeList,
id=('_getPortalGroupedTypeList', group), id=('_getPortalGroupedTypeList', group),
cache_duration=3600) cache_factory='erp5_core_medium')
return getTypeList(group) return getTypeList(group)
def _getPortalGroupedCategoryList(self, group): def _getPortalGroupedCategoryList(self, group):
...@@ -415,7 +415,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -415,7 +415,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getCategoryList = CachingMethod( getCategoryList = CachingMethod(
getCategoryList, getCategoryList,
id=('_getPortalGroupedCategoryList', group), id=('_getPortalGroupedCategoryList', group),
cache_duration=3600) cache_factory='erp5_core_medium')
return getCategoryList(group) return getCategoryList(group)
def _getPortalGroupedStateList(self, group): def _getPortalGroupedStateList(self, group):
...@@ -433,7 +433,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -433,7 +433,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getStateList = CachingMethod(getStateList, getStateList = CachingMethod(getStateList,
id=('_getPortalGroupedStateList', group), id=('_getPortalGroupedStateList', group),
cache_duration=3600) cache_factory='erp5_core_medium')
return getStateList(group) return getStateList(group)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
...@@ -137,7 +137,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool): ...@@ -137,7 +137,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
""" """
def getBaseCategoryDict(self): def getBaseCategoryDict(self):
return dict.fromkeys(self.getBaseCategoryList(), None) 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, def updateRelatedContent(self, context,
previous_category_url, new_category_url): 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