Commit f5e3f6fe authored by Sebastien Robin's avatar Sebastien Robin

defined cache factory instead of cache duration

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13644 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ff48f61b
......@@ -71,7 +71,9 @@ def getCheckbookTypeItemList():\n
return [(\'\', \'\')] + [(x.getTitle(), x.getRelativeUrl())\n
for x in context.checkbook_type_module.objectValues()]\n
\n
getCheckbookTypeItemList = CachingMethod(getCheckbookTypeItemList, id = \'Baobab_getCheckbookTypeItemList\', cache_duration = 3600)\n
getCheckbookTypeItemList = CachingMethod(getCheckbookTypeItemList, \n
id = \'Baobab_getCheckbookTypeItemList\', \n
cache_factory = \'erp5_ui_medium\')\n
return getCheckbookTypeItemList()\n
</string> </value>
</item>
......
......@@ -85,7 +85,9 @@ def getResourceVintageList(banknote=0, coin=0):\n
return variation_list.keys()\n
\n
\n
getResourceVintageList = CachingMethod(getResourceVintageList, id=\'Baobab_getResourceVintageList\', cache_duration=360000)\n
getResourceVintageList = CachingMethod(getResourceVintageList, \n
id=\'Baobab_getResourceVintageList\', \n
cache_factory="erp5_ui_long")\n
\n
return getResourceVintageList(banknote, coin)\n
</string> </value>
......
......@@ -85,7 +85,8 @@ def getFunctionList(user_id=user_id):\n
function_list.extend(new_function_list)\n
return function_list\n
\n
getFunctionList = CachingMethod(getFunctionList, id=\'Baobab_getUserAssignedFunctionList\', cache_duration=300)\n
getFunctionList = CachingMethod(getFunctionList, id=\'Baobab_getUserAssignedFunctionList\', \n
cache_factory="erp5_ui_short")\n
return getFunctionList()\n
......
......@@ -85,7 +85,7 @@ def getSiteList(user_id=user_id):\n
site_list.append(new_site)\n
return site_list\n
\n
getSiteList = CachingMethod(getSiteList, id=\'Baobab_getUserAssignedSiteList\', cache_duration=300)\n
getSiteList = CachingMethod(getSiteList, id=\'Baobab_getUserAssignedSiteList\', cache_factory=\'erp5_ui_short\')\n
return getSiteList(user_id=user_id)\n
</string> </value>
</item>
......
......@@ -67,13 +67,11 @@
<key> <string>_body</string> </key>
<value> <string># This script will try to guess what is the current currency\n
# for the particular vault\n
from Products.ERP5Type.Cache import CachingMethod\n
\n
vault_list = vault.split(\'/\')\n
currency_id = None\n
# Well, this is not a nice way of doing, we should have\n
# a mapping or something instead\n
context.log(\'Baobab_getVaultCurrency vault_list\',vault_list)\n
if \'encaisse_des_devises\' in vault_list:\n
vault_currency_title = vault_list[vault_list.index(\'encaisse_des_devises\')+1]\n
for currency in context.currency_module.objectValues():\n
......@@ -131,16 +129,14 @@ return context.currency_module[context.Baobab_getPortalReferenceCurrencyID()].ge
<tuple>
<string>vault</string>
<string>kw</string>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
<string>_getattr_</string>
<string>vault_list</string>
<string>None</string>
<string>currency_id</string>
<string>context</string>
<string>_getitem_</string>
<string>vault_currency_title</string>
<string>_getiter_</string>
<string>context</string>
<string>currency</string>
<string>currency_title</string>
</tuple>
......
......@@ -78,7 +78,8 @@ def getCurrencyList(exclude_reference_currency=0):\n
currency_list.insert(0, (\'\',\'\'))\n
return currency_list\n
\n
getCurrencyList = CachingMethod(getCurrencyList, id = \'CurrencyExchange_getCurrencyList\', cache_duration = 3600)\n
getCurrencyList = CachingMethod(getCurrencyList, id = \'CurrencyExchange_getCurrencyList\', \n
cache_factory = "erp5_ui_medium")\n
return getCurrencyList(exclude_reference_currency=exclude_reference_currency)\n
</string> </value>
</item>
......
......@@ -77,10 +77,10 @@
# Delivery_getVaultItemList utilis\xc3\xa9 dans le TALES de my_source dans le formulaire\n
# user_site = 1 : Permet de s\xc3\xa9lectionner uniquement les encaisses des sites auquels l\'user est affect\xc3\xa9,\n
# au lieu des encaisses de tous le sites\n
# exclude_user_site = 0 : Permet de ne pas s\xe9lectionner les encaisses du site auquel appartient l\'utilisateur\n
# exclude_user_site = 0 : Permet de ne pas s\xef\xbf\xbdlectionner les encaisses du site auquel appartient l\'utilisateur\n
# owner_site = 1 : Permet de s\xc3\xa9lectionner uniquement les encaisses des sites auquels le propri\xc3\xa9taire du document est affect\xc3\xa9,\n
# au lieu des encaisses de tous le sites\n
# main_agency = 0 : Permet de s\xc3\xa9lectionner uniquement les encaisses des sites qui appartiennent \xe0 une agence principale,\n
# main_agency = 0 : Permet de s\xc3\xa9lectionner uniquement les encaisses des sites qui appartiennent \xef\xbf\xbd une agence principale,\n
# leaf_node = 1 : S\xc3\xa9lectionne uniquement les noeuds qui sont des feuilles de l\'arbre (qui n\'ont pas de sous-cat\xc3\xa9gories)\n
# strict_membership = 0 : Appartenance stricte. Si vault_type=\'site\', on s\xc3\xa9lectionnera \'site/agence/principale/paris\',\n
# mais pas \'site/agence/principale/paris/caveau\', \'site/agence/principale/paris/surface\' et\n
......@@ -216,7 +216,8 @@ def getVaultItemList(vault_type=None, exclude_vault_type=None,\n
vault_list.sort()\n
return vault_list\n
\n
getVaultItemList = CachingMethod(getVaultItemList, id=(\'Delivery_getVaultItemList\', \'getVaultItemList\'), cache_duration=None)\n
getVaultItemList = CachingMethod(getVaultItemList, id=(\'Delivery_getVaultItemList\', \'getVaultItemList\'), \n
cache_factory=\'erp5_ui_long\')\n
\n
if vault_type is None:\n
assignment_list = context.Baobab_getUserAssignmentList()\n
......
......@@ -74,7 +74,8 @@ def Movement_lookupPrice():\n
else:\n
return None\n
\n
return CachingMethod(Movement_lookupPrice, (\'erp5_banking_core/Movement_lookupPrice\', context.getResource()), cache_duration=None)()\n
return CachingMethod(Movement_lookupPrice, (\'erp5_banking_core/Movement_lookupPrice\', context.getResource()), \n
cache_factory="erp5_ui_long")()\n
</string> </value>
</item>
<item>
......@@ -128,8 +129,7 @@ return CachingMethod(Movement_lookupPrice, (\'erp5_banking_core/Movement_lookupP
<string>CachingMethod</string>
<string>Movement_lookupPrice</string>
<string>_getattr_</string>
<string>context</string>
<string>None</string>
<string>context</string>
</tuple>
</value>
</item>
......
170
\ No newline at end of file
172
\ No newline at end of file
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