Commit fa4ca0c5 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Your Name

erp5_trade: drop caching method for resource list

benefit is very small and unusable for user

nexedi/erp5@1f254aa7
parent c7783906
...@@ -41,30 +41,19 @@ if len(sql_kw) == 0: ...@@ -41,30 +41,19 @@ if len(sql_kw) == 0:
except AttributeError: except AttributeError:
pass pass
def getResourceItemList(sql_kw): sql_kw['portal_type'] = portal_type
portal = context.getPortalObject() sql_kw['validation_state'] = validation_state
sql_kw['default_use_uid'] = [context.portal_categories.resolveCategory(use).getUid()
for use in use_list]
sql_kw['limit'] = 20
result = [] result = []
for resource in portal.portal_catalog.searchResults(sort_on=(('portal_type', 'asc'), for resource in portal.portal_catalog.searchResults(sort_on=(('portal_type', 'asc'),
('title', 'asc')), ('title', 'asc')),
**sql_kw): **sql_kw):
result.append( result.append(
(resource.getTitle(), (resource.getTitle(),
resource.getRelativeUrl())) resource.getRelativeUrl()))
result.append(('', '')) result.append(('', ''))
return result return result
sql_kw['portal_type'] = portal_type
sql_kw['validation_state'] = validation_state
sql_kw['default_use_uid'] = [context.portal_categories.resolveCategory(use).getUid()
for use in use_list]
getResourceItemList = CachingMethod(getResourceItemList, ("getResourceItemList", context.aq_parent.getId()),
cache_factory="erp5_ui_short")
return getResourceItemList(sql_kw)
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