[Erp5-report] r26502 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sun Apr 19 22:50:21 CEST 2009


Author: jp
Date: Sun Apr 19 22:50:20 2009
New Revision: 26502

URL: http://svn.erp5.org?rev=26502&view=rev
Log:
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.

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=26502&r1=26501&r2=26502&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Sun Apr 19 22:50:20 2009
@@ -398,7 +398,7 @@
       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 @@
   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 @@
       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




More information about the Erp5-report mailing list