Commit 059a6722 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Implemented support for properties and local properties


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4503 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 800dd57d
......@@ -129,15 +129,25 @@ def PropertyManager_propertyIds(self):
def PropertyManager_propertyValues(self):
"""Return a list of actual property objects """
return map(lambda i,s=self: getattr(s,i['id']), self._propertyMap())
return map(lambda i,s=self: s.getProperty(i['id']), self._propertyMap())
def PropertyManager_propertyItems(self):
"""Return a list of (id,property) tuples """
return map(lambda i,s=self: (i['id'],getattr(s,i['id'])), self._propertyMap())
return map(lambda i,s=self: (i['id'],s.getProperty(i['id'])), self._propertyMap())
def PropertyManager_propertyMap(self):
"""Return a tuple of mappings, giving meta-data for properties """
return tuple(list(self._properties) + list(getattr(self, '_local_properties', ())))
property_map = list(self._properties)
property_dict = {}
for p in property_map:
property_dict[p['id']] = None
# base_id is defined for properties which are associated to multiple accessors
if p.has_key('base_id'): property_dict[p['base_id']] = None
# Only add those local properties which are not global
for p in getattr(self, '_local_properties', ()):
if not property_dict.has_key(p['id']):
property_map.append(p)
return tuple(property_map)
def PropertyManager_propdict(self):
dict={}
......
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