[Erp5-report] r43352 arnaud.fontaine - /erp5/trunk/products/ERP5Type/Core/PropertySheet.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 15 15:04:45 CET 2011
Author: arnaud.fontaine
Date: Tue Feb 15 15:04:45 2011
New Revision: 43352
URL: http://svn.erp5.org?rev=43352&view=rev
Log:
Accessor generation used to first generate accessors for properties,
*then* accessors for categories only if the latter accessors have not
been defined by the former (by using 'hasattr'). As the 'hasattr'es
have been removed, the reverse operation is performed to maintain
backward-compatibility
Modified:
erp5/trunk/products/ERP5Type/Core/PropertySheet.py
Modified: erp5/trunk/products/ERP5Type/Core/PropertySheet.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Core/PropertySheet.py?rev=43352&r1=43351&r2=43352&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Core/PropertySheet.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Core/PropertySheet.py [utf8] Tue Feb 15 15:04:45 2011
@@ -217,5 +217,19 @@ class PropertySheet(Folder):
security.declareProtected(Permissions.AccessContentsInformation,
'applyOnAccessorHolder')
def applyOnAccessorHolder(self, accessor_holder, expression_context, portal):
- for property in self.contentValues():
- property.applyOnAccessorHolder(accessor_holder, expression_context, portal)
+ # Accessor generation used to first generate accessors for
+ # properties, *then* accessors for categories only if the latter
+ # accessors have not been defined by the former (by using
+ # 'hasattr'). As the 'hasattr'es have been removed, the reverse
+ # operation is performed to maintain backward-compatibility
+ property_definition_list = []
+ for property_definition in self.contentValues():
+ if property_definition.getPortalType().endswith('Category Property'):
+ property_definition_list.insert(0, property_definition)
+ else:
+ property_definition_list.append(property_definition)
+
+ for property_definition in property_definition_list:
+ property_definition.applyOnAccessorHolder(accessor_holder,
+ expression_context,
+ portal)
More information about the Erp5-report
mailing list