[Erp5-report] r33697 jm - /erp5/trunk/products/ERP5/Document/Document.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Mar 12 17:08:35 CET 2010
Author: jm
Date: Fri Mar 12 17:08:34 2010
New Revision: 33697
URL: http://svn.erp5.org?rev=33697&view=rev
Log:
Remove 2 useless caches because _getTypeBasedMethod already caches results
Modified:
erp5/trunk/products/ERP5/Document/Document.py
Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=33697&r1=33696&r2=33697&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Fri Mar 12 17:08:34 2010
@@ -220,27 +220,12 @@
if name is None:
return self.getDefaultDocumentValue()
- cache = getReadOnlyTransactionCache(self)
- method = None
- if cache is not None:
- key = ('getDocumentValue', self)
- try:
- method = cache[key]
- except KeyError:
- pass
-
- if method is None:
- method = self._getTypeBasedMethod('getDocumentValue',
+ method = self._getTypeBasedMethod('getDocumentValue',
fallback_script_id='WebSection_getDocumentValue')
-
- if cache is not None:
- if cache.get(key, _MARKER) is _MARKER:
- cache[key] = method
document = method(name, portal=portal, **kw)
if document is not None:
- document = document.__of__(self)
- return document
+ return document.__of__(self)
class DocumentProxyMixin:
"""
@@ -695,18 +680,7 @@
NOTE: passing a group_by parameter may be useful at a
later stage of the implementation.
"""
- tv = getTransactionalVariable(self) # XXX Performance improvement required
- cache_key = ('getImplicitPredecessorValueList', self.getPhysicalPath())
- try:
- return tv[cache_key]
- except KeyError:
- pass
-
- method = self._getTypeBasedMethod('getImplicitPredecessorValueList',
- fallback_script_id = 'Base_getImplicitPredecessorValueList')
- result = method()
- tv[cache_key] = result
- return result
+ return self._getTypeBasedMethod('getImplicitPredecessorValueList')()
security.declareProtected(Permissions.AccessContentsInformation, 'getImplicitSimilarValueList')
def getImplicitSimilarValueList(self):
More information about the Erp5-report
mailing list