Commit f1bbc5aa by Xiaowu Zhang

erp5_trade: drop caching method for resource list

benefit is very small and unusable for user

1f254aa7
1 parent 213974eb
......@@ -41,30 +41,19 @@ if len(sql_kw) == 0:
except AttributeError:
pass
def getResourceItemList(sql_kw):
portal = context.getPortalObject()
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]
sql_kw['limit'] = 20
result = []
for resource in portal.portal_catalog.searchResults(sort_on=(('portal_type', 'asc'),
result = []
for resource in portal.portal_catalog.searchResults(sort_on=(('portal_type', 'asc'),
('title', 'asc')),
**sql_kw):
result.append(
(resource.getTitle(),
resource.getRelativeUrl()))
result.append(('', ''))
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)
result.append(('', ''))
return result
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!