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:
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)
......
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