Commit b4bf3573 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

support '*_list' property.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33297 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3b9d1cd9
......@@ -56,10 +56,15 @@ class PropertyMapping(XMLObject):
security.declareProtected(Permissions.AccessContentsInformation,
'getMappedValue')
def getMappedValue(self, document, property):
if property.endswith('_list'):
property = property[:-5]
getProperty = document.getPropertyList
else:
getProperty = document.getProperty
mapping_dict = dict([[x.strip() for x in x.split('|')] \
for x in self.getMappingPropertyList()])
mapped_property = mapping_dict.get(property, property)
if mapped_property.startswith('-'):
return -1 * document.getProperty(mapped_property[1:])
return -1 * getProperty(mapped_property[1:])
else:
document.getProperty(mapped_property)
return getProperty(mapped_property)
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