[Erp5-report] r41748 kazuhiko - /erp5/trunk/products/ERP5/Document/Document.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Dec 24 11:58:03 CET 2010
Author: kazuhiko
Date: Fri Dec 24 11:58:03 2010
New Revision: 41748
URL: http://svn.erp5.org?rev=41748&view=rev
Log:
add a backward compatibility code.
getFilename() should return existing source_reference value for old documents.
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=41748&r1=41747&r2=41748&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Fri Dec 24 11:58:03 2010
@@ -787,3 +787,14 @@ class Document(DocumentExtensibleTravers
if hasattr(aq_base(container), 'isIndexContent'):
return container.isIndexContent(self)
return False
+
+ # backward compatibility
+ def getFilename(self, default=None):
+ if self.hasFilename():
+ return self._baseGetFilename(default)
+ elif self.hasSourceReference():
+ filename = self._baseGetSourceReference(default)
+ self._setFilename(filename)
+ return filename
+ else:
+ return default
More information about the Erp5-report
mailing list