Commit 6ed038d1 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Change the way of getting a value again. First, try getProperty, and use...

Change the way of getting a value again. First, try getProperty, and use getattr only if getProperty does not find anything.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8245 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e69ff3a5
...@@ -1786,15 +1786,14 @@ class ListBoxRendererLine: ...@@ -1786,15 +1786,14 @@ class ListBoxRendererLine:
except ValueError: except ValueError:
property_id = sql property_id = sql
original_value = getattr(obj, property_id, None) try:
processed_value = original_value original_value = obj.getProperty(property_id, _marker)
if not callable(original_value): if original_value is _marker:
try: raise AttributeError, property_id
original_value = obj.getProperty(property_id) processed_value = original_value
processed_value = original_value except AttributeError:
except AttributeError: original_value = getattr(obj, property_id, None)
original_value = getattr(obj, property_id) processed_value = original_value
processed_value = original_value
except (AttributeError, KeyError): except (AttributeError, KeyError):
original_value = None original_value = None
processed_value = 'Could not evaluate %s' % property_id processed_value = 'Could not evaluate %s' % property_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