Commit 090a67e4 authored by Bartek Górny's avatar Bartek Górny

made getStandardFileName a type-based method (as the docstring said that it should be)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14781 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0d644f0
...@@ -932,18 +932,10 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -932,18 +932,10 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
""" """
Returns the document coordinates as a standard file name. This Returns the document coordinates as a standard file name. This
method is the reverse of getPropertyDictFromFileName. method is the reverse of getPropertyDictFromFileName.
NOTE: this method must be overloadable by types base method with fallback
""" """
if self.getReference(): method = self._getTypeBasedMethod('getStandardFileName',
file_name = self.getReference() fallback_script_id = 'Document_getStandardFileName')
else: return method()
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
### Metadata disovery and ingestion methods ### Metadata disovery and ingestion methods
security.declareProtected(Permissions.ModifyPortalContent, 'discoverMetadata') security.declareProtected(Permissions.ModifyPortalContent, 'discoverMetadata')
......
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