From 1259e84ddbade74b3315c8bd5428294e6b26d5e1 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Tue, 7 Nov 2006 08:06:21 +0000 Subject: [PATCH] Revert changes for generation of cache_id when no arguments are passed (static defined in CachingMethod) git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11139 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Cache.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/product/ERP5Type/Cache.py b/product/ERP5Type/Cache.py index b56244eb0f..5adce9b458 100644 --- a/product/ERP5Type/Cache.py +++ b/product/ERP5Type/Cache.py @@ -193,25 +193,20 @@ class CachingMethod: def generateCacheId(self, method_id, *args, **kwd): """ Generate proper cache id based on *args and **kwd """ - if args==() and kwd == {}: - ## we have static method_id without any argument passed - ## so we return it as it is. - return str(method_id) - else: - ## generate cache id out of arguments passed. - ## depending on arguments we may have different - ## cache_id for same method_id - cache_id = [method_id] - key_list = kwd.keys() - key_list.sort() - for arg in args: - cache_id.append((None, arg)) - for key in key_list: - cache_id.append((key, str(kwd[key]))) - cache_id = str(cache_id) - ## because some cache backends don't allow some chars in cached id we make sure to replace them - cache_id = cache_id.translate(self._cache_id_translate_table) - return cache_id + ## generate cache id out of arguments passed. + ## depending on arguments we may have different + ## cache_id for same method_id + cache_id = [method_id] + key_list = kwd.keys() + key_list.sort() + for arg in args: + cache_id.append((None, arg)) + for key in key_list: + cache_id.append((key, str(kwd[key]))) + cache_id = str(cache_id) + ## because some cache backends don't allow some chars in cached id we make sure to replace them + cache_id = cache_id.translate(self._cache_id_translate_table) + return cache_id allow_class(CachingMethod) -- 2.30.9