[Erp5-report] r43413 luke - /erp5/trunk/products/ERP5Type/dynamic/lazy_class.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 17 12:56:51 CET 2011


Author: luke
Date: Thu Feb 17 12:56:51 2011
New Revision: 43413

URL: http://svn.erp5.org?rev=43413&view=rev
Log:
 - return unique list of properties, from property's id point of view
Note: It is acceptable to merge duplicates of same property, it was
working like this before.

Modified:
    erp5/trunk/products/ERP5Type/dynamic/lazy_class.py

Modified: erp5/trunk/products/ERP5Type/dynamic/lazy_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/lazy_class.py?rev=43413&r1=43412&r2=43413&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/lazy_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/lazy_class.py [utf8] Thu Feb 17 12:56:51 2011
@@ -137,16 +137,21 @@ class PortalTypeMetaClass(GhostBaseMetaC
 
   def getAccessorHolderPropertyList(cls):
     """
-    Get all the properties as defined in the accessor holders,
+    Get unique properties, by its id, as defined in the accessor holders,
     meaningful for _propertyMap for example
 
     @see Products.ERP5Type.Base.Base._propertyMap
     """
     cls.loadClass()
+    property_id_set = set()
     property_list = []
     for klass in cls.mro():
       if klass.__module__ == 'erp5.accessor_holder':
-        property_list.extend(klass._properties)
+        for property in klass._properties:
+          if property['id'] in property_id_set:
+            continue
+          property_id_set.update([property['id']])
+          property_list.append(property)
 
     return property_list
 



More information about the Erp5-report mailing list