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:
except ValueError:
property_id = sql
original_value = getattr(obj, property_id, None)
processed_value = original_value
if not callable(original_value):
try:
original_value = obj.getProperty(property_id)
processed_value = original_value
except AttributeError:
original_value = getattr(obj, property_id)
processed_value = original_value
try:
original_value = obj.getProperty(property_id, _marker)
if original_value is _marker:
raise AttributeError, property_id
processed_value = original_value
except AttributeError:
original_value = getattr(obj, property_id, None)
processed_value = original_value
except (AttributeError, KeyError):
original_value = None
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