Commit 1259e84d authored by Ivan Tyagov's avatar Ivan Tyagov

Revert changes for generation of cache_id when no arguments are passed (static...

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
parent 7fbf0468
...@@ -193,25 +193,20 @@ class CachingMethod: ...@@ -193,25 +193,20 @@ class CachingMethod:
def generateCacheId(self, method_id, *args, **kwd): def generateCacheId(self, method_id, *args, **kwd):
""" Generate proper cache id based on *args and **kwd """ """ Generate proper cache id based on *args and **kwd """
if args==() and kwd == {}: ## generate cache id out of arguments passed.
## we have static method_id without any argument passed ## depending on arguments we may have different
## so we return it as it is. ## cache_id for same method_id
return str(method_id) cache_id = [method_id]
else: key_list = kwd.keys()
## generate cache id out of arguments passed. key_list.sort()
## depending on arguments we may have different for arg in args:
## cache_id for same method_id cache_id.append((None, arg))
cache_id = [method_id] for key in key_list:
key_list = kwd.keys() cache_id.append((key, str(kwd[key])))
key_list.sort() cache_id = str(cache_id)
for arg in args: ## because some cache backends don't allow some chars in cached id we make sure to replace them
cache_id.append((None, arg)) cache_id = cache_id.translate(self._cache_id_translate_table)
for key in key_list: return cache_id
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) allow_class(CachingMethod)
......
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