From 38e3b2909fb5bc62d52d738d5f8464f95fce71a4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Tue, 21 Dec 2004 12:01:21 +0000 Subject: [PATCH] building property sheet list now takes into account superclasses git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2070 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Base.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py index 26decae7d1..477379dd9a 100755 --- a/product/ERP5Type/Base.py +++ b/product/ERP5Type/Base.py @@ -87,6 +87,13 @@ class PropertyHolder: def __init__(self): self.__name__ = 'PropertyHolder' +def getClassPropertyList(klass): + ps_list = getattr(klass, 'property_sheets', ()) + ps_list = tuple(ps_list) + for super_klass in klass.__bases__: + if getattr(super_klass, 'isRADContent', 0): ps_list = ps_list + getClassPropertyList(super_klass) + return ps_list + def initializeClassDynamicProperties(self, klass, recursive=0): id = '' #LOG('before aq_method_generated %s' % id, 0, str(klass.__name__)) @@ -128,9 +135,10 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0): # Always append the klass.property_sheets to this list (for compatibility) # Because of the order we generate accessors, it is still possible # to overload data access for some accessors - ps_list = tuple(ps_list) + tuple(klass.property_sheets) + ps_list = tuple(ps_list) + getClassPropertyList(klass) + #LOG('ps_list',0, str(ps_list)) else: - ps_list = getattr(klass, 'property_sheets', ()) + ps_list = getClassPropertyList(klass) for base in ps_list: prop_list += base._properties if hasattr(base, '_categories'): -- 2.30.9