Commit c98fe62a authored by Jérome Perrin's avatar Jérome Perrin

Report an easyier to understand message when property sheet are not well defined


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4259 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2803d14a
...@@ -173,14 +173,21 @@ def initializePortalTypeDynamicProperties(self, klass, ptype): ...@@ -173,14 +173,21 @@ def initializePortalTypeDynamicProperties(self, klass, ptype):
ps_list = getClassPropertyList(klass) ps_list = getClassPropertyList(klass)
for base in ps_list: for base in ps_list:
if hasattr(base, '_properties'): if hasattr(base, '_properties'):
if type(base._properties) in (type(()), type([])):
prop_list += base._properties prop_list += base._properties
else :
raise ValueError, "_properties is not a list for %s" % base
if hasattr(base, '_categories'): if hasattr(base, '_categories'):
if type(base._categories) in (type(()), type([])): if type(base._categories) in (type(()), type([])):
cat_list += base._categories cat_list += base._categories
else: else:
cat_list += [base._categories] cat_list += [base._categories]
if hasattr(base, '_constraints'): if hasattr(base, '_constraints'):
if type(base._constraints) in (type(()), type([])):
constraint_list += base._constraints constraint_list += base._constraints
else :
raise ValueError, "_constraints is not a list for %s" % base
if ptype_object is not None and ptype_object.meta_type == 'ERP5 Type Information': if ptype_object is not None and ptype_object.meta_type == 'ERP5 Type Information':
cat_list += ptype_object.base_category_list cat_list += ptype_object.base_category_list
prop_holder._properties = prop_list prop_holder._properties = prop_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