Commit d2153773 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Only use getObject if needed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20637 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 02d029b2
......@@ -1925,7 +1925,7 @@ class ListBoxRendererLine:
processed_value = original_value
else:
# This is an usual line.
obj = self.getObject()
obj = None # Only evaluate if needed
brain = self.getBrain()
# Use a widget, if any.
......@@ -1934,16 +1934,19 @@ class ListBoxRendererLine:
if editable_field is not None:
tales = editable_field.tales.get('default', '')
if tales:
if obj is None: obj = self.getObject()
original_value = editable_field.__of__(obj).get_value('default',
cell=brain)
processed_value = original_value
# If a tales expression is not defined, get a skin, an accessor or a property.
if not tales:
if brain is not obj and getattr(aq_self(brain), alias, None) is not None:
if (obj is None or brain is not obj) and getattr(aq_self(brain), alias, None) is not None:
original_value = getattr(brain, alias)
processed_value = original_value
elif obj is not None:
else:
obj = self.getObject()
if obj is not None:
try:
# Get the trailing part.
try:
......
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