Commit 9a4529b4 authored by Jérome Perrin's avatar Jérome Perrin

generate aquired properties accessors for subobject with default_ prefix

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6839 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent efb4a67b
...@@ -1568,10 +1568,8 @@ def createDefaultAccessors(property_holder, id, prop = None, ...@@ -1568,10 +1568,8 @@ def createDefaultAccessors(property_holder, id, prop = None,
setattr(property_holder, accessor_name, list_accessor.dummy_copy(accessor_name)) setattr(property_holder, accessor_name, list_accessor.dummy_copy(accessor_name))
if prop.has_key('acquired_property_id'): if prop.has_key('acquired_property_id'):
for aq_id in prop['acquired_property_id']: for aq_id in prop['acquired_property_id']:
composed_id = "%s_%s" % (id, aq_id) for composed_id in ("%s_%s" % (id, aq_id), "default_%s_%s" % (id, aq_id)) :
# print "Set composed_id accessor %s" % composed_id
accessor_name = 'get' + UpperCase(composed_id) accessor_name = 'get' + UpperCase(composed_id)
# print "Set accessor_name accessor %s" % accessor_name
base_accessor = ContentProperty.Getter(accessor_name, composed_id, prop['type'], aq_id, base_accessor = ContentProperty.Getter(accessor_name, composed_id, prop['type'], aq_id,
portal_type = prop.get('portal_type'), storage_id = prop.get('storage_id')) portal_type = prop.get('portal_type'), storage_id = prop.get('storage_id'))
if not hasattr(property_holder, accessor_name) or prop.get('override',0): if not hasattr(property_holder, accessor_name) or prop.get('override',0):
......
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