Commit ae3759a8 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added standard file name method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13686 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c6050b7
...@@ -1160,3 +1160,22 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -1160,3 +1160,22 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
classes is needed. classes is needed.
""" """
return DateTime() + 10 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
\ No newline at end of file
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