[Erp5-report] r11139 - /erp5/trunk/products/ERP5Type/Cache.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Nov 7 09:06:28 CET 2006
Author: ivan
Date: Tue Nov 7 09:06:21 2006
New Revision: 11139
URL: http://svn.erp5.org?rev=11139&view=rev
Log:
Revert changes for generation of cache_id when no arguments are passed (static defined in CachingMethod)
Modified:
erp5/trunk/products/ERP5Type/Cache.py
Modified: erp5/trunk/products/ERP5Type/Cache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Cache.py?rev=11139&r1=11138&r2=11139&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Cache.py (original)
+++ erp5/trunk/products/ERP5Type/Cache.py Tue Nov 7 09:06:21 2006
@@ -193,25 +193,20 @@
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)
More information about the Erp5-report
mailing list