Commit 81de1133 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use getProperty or getPropertyList appropriately instead of using getPropertyList everywhere.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30902 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d7a695c5
...@@ -60,10 +60,21 @@ class PropertyRecordableMixin: ...@@ -60,10 +60,21 @@ class PropertyRecordableMixin:
id -- ID of the property id -- ID of the property
""" """
try:
property_info = [x for x in self.getPropertyMap() \
if x['id'] == id][0]
except IndexError:
if id in self.getBaseCategoryList():
value = self.getPropertyList(id)
else: # should be local property
value = self.getProperty(id)
else:
if x['type'] in list_types:
value = self.getPropertyList(id)
else:
value = self.getProperty(id)
recorded_property_dict = self._getRecordedPropertyDict() recorded_property_dict = self._getRecordedPropertyDict()
# XXX it is better to use getPropertyList only for list type recorded_property_dict[id] = value
# properties or categories.
recorded_property_dict[id] = self.getPropertyList(id)
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'clearRecordedProperty') 'clearRecordedProperty')
......
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