[Erp5-report] r13686 - /erp5/trunk/products/ERP5/Document/Document.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 27 00:38:22 CEST 2007


Author: jp
Date: Tue Mar 27 00:38:21 2007
New Revision: 13686

URL: http://svn.erp5.org?rev=13686&view=rev
Log:
Added standard file name method

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=13686&r1=13685&r2=13686&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py (original)
+++ erp5/trunk/products/ERP5/Document/Document.py Tue Mar 27 00:38:21 2007
@@ -1160,3 +1160,22 @@
     classes is needed.
     """
     return DateTime() + 10
+
+  # Standard File Naming
+  security.declareProtected(Permissions.AccessContentsInformation, 'getStandardFileName')
+  def getStandardFileName(self):
+    """
+    Returns the document coordinates as a standard file name.
+
+    NOTE: this method must be overloadable by types base method with fallback
+    """
+    if self.getReference():
+      file_name = self.getReference()
+    else:
+      file_name = self.getTitleOrId()
+    if self.getVersion():
+      file_name = file_name + '-%s' % self.getVersion()
+    if self.getLanguage():
+      file_name = file_name + '-%s' % self.getLanguage()
+    return file_name
+  




More information about the Erp5-report mailing list