Commit dfa004d3 authored by Łukasz Nowak's avatar Łukasz Nowak

- 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.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43413 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 08deb842
...@@ -137,16 +137,21 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -137,16 +137,21 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
def getAccessorHolderPropertyList(cls): 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 meaningful for _propertyMap for example
@see Products.ERP5Type.Base.Base._propertyMap @see Products.ERP5Type.Base.Base._propertyMap
""" """
cls.loadClass() cls.loadClass()
property_id_set = set()
property_list = [] property_list = []
for klass in cls.mro(): for klass in cls.mro():
if klass.__module__ == 'erp5.accessor_holder': 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 return property_list
......
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