Commit 6455348f authored by Jean-Paul Smets's avatar Jean-Paul Smets

It was inconsistent to call getProperty then getReference (hasReference then...

It was inconsistent to call getProperty then getReference (hasReference then getReference is also consistent). Added title_or_id method as alias to getTitleOrId, just for CMF compatibility.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26502 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd6e1801
......@@ -398,7 +398,7 @@ class PropertyHolder:
by postponing security declaration.
WARNING: we optimize size by not setting security if
it is the same as the default. This may be a bit
it is the same as the default. This may be a bit
dangerous if classes use another default
security.
"""
......@@ -2409,10 +2409,15 @@ class Base( CopyContainer,
security.declareProtected( Permissions.View, 'Title' )
Title = getTitleOrId
# CMF Compatibility
security.declareProtected( Permissions.View, 'title_or_id' )
title_or_id = getTitleOrId
security.declareProtected(Permissions.AccessContentsInformation,
'getTitleAndId')
def getTitleAndId(self):
"""Returns the title and the id in parenthesis
"""
Returns the title and the id in parenthesis
"""
return self.title_and_id()
......@@ -2524,7 +2529,7 @@ class Base( CopyContainer,
r = self.getShortTitle()
if r: return r
if self.getProperty('reference'):
r = self.getReference()
r = self.getProperty('reference')
if r: return r
r = self._baseGetTitle() # No need to test existence since all Base instances have this method
if r: return r # Also useful whenever title is calculated
......
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