From 45d8d248f65c3f870e3829145424e1748673f44d Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Fri, 12 Feb 2010 14:23:54 +0000 Subject: [PATCH] Compute a better Cache Key to refresh modified object list rigth after installation of BusinessTemplate. Usefull when calling reinstall just after a fresh installation. Reviewed by Seb git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32498 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../BusinessTemplate_getModifiedObject.xml | 13 ++++++++++++- product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getModifiedObject.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getModifiedObject.xml index 2df4037ab6..953c7971b8 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getModifiedObject.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getModifiedObject.xml @@ -61,9 +61,18 @@ def getModifiedObjectList(context):\n result = context.preinstall()\n return result\n \n +def cacheIdGenerator(method_id, *args, **kw):\n + context = args[0]\n + return \'%s%s%s\' % (method_id,\n + context.getUid(),\n + context.getModificationDate().timeTime())\n +\n +cache_id_generator = cacheIdGenerator\n +\n getModifiedObjectList = CachingMethod(getModifiedObjectList,\n id=\'BusinessTemplate_getModifiedObjectList\',\n - cache_factory=\'erp5_ui_medium\')\n + cache_factory=\'erp5_ui_medium\',\n + cache_id_generator=cache_id_generator)\n \n modified_object_list = getModifiedObjectList(context)\n keys = modified_object_list.keys()\n @@ -159,6 +168,8 @@ return object_list\n <string>context</string> <string>Base_translateString</string> <string>getModifiedObjectList</string> + <string>cacheIdGenerator</string> + <string>cache_id_generator</string> <string>modified_object_list</string> <string>keys</string> <string>no_backup_list</string> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 74532d807c..029aeb486f 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -1471 \ No newline at end of file +1474 \ No newline at end of file -- 2.30.9