Commit c021bdd7 authored by Sebastien Robin's avatar Sebastien Robin

too many getter/setters/testers were generated in the case

of group type method (like isResourceType). Because of this,
_aq_dynamic was sometimes failing with maximum recursion depth

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30752 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f17acd6
......@@ -1603,14 +1603,14 @@ def createDefaultAccessors(property_holder, id, prop = None,
######################################################
# Create Portal Category Type Accessors.
if prop.get('group_type'):
if prop['type'] == 'group_type':
createGroupTypeAccessors(property_holder, prop,
read_permission=read_permission,
portal=portal)
######################################################
# Create Getters
if prop.has_key('acquisition_base_category'):
elif prop.has_key('acquisition_base_category'):
# Create getters for an acquired property
# XXXX Missing Boolean accessor
accessor_args = (
......@@ -1880,7 +1880,10 @@ def createDefaultAccessors(property_holder, id, prop = None,
property_holder.registerAccessor(accessor_name, id, Base.Getter, accessor_args)
######################################################
# Create Setters
if prop['type'] in list_types or prop.get('multivalued', 0):
if prop['type'] == 'group_type':
# No setter
pass
elif prop['type'] in list_types or prop.get('multivalued', 0):
# Create setters for a list property by aliasing
setter_name = 'set' + UpperCase(id)
if not hasattr(property_holder, setter_name):
......@@ -1996,7 +1999,10 @@ def createDefaultAccessors(property_holder, id, prop = None,
property_holder.registerAccessor(setter_name, id, Base.Setter, accessor_args)
######################################################
# Create testers
if prop['type'] == 'content':
if prop['type'] == 'group_type':
# No testters
pass
elif prop['type'] == 'content':
# XXX This approach is wrong because testers for all properties
# should be created upfront rather than on demand
accessor_args = (prop['type'], prop.get('storage_id'))
......
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