Commit 8fb88e46 authored by Julien Muchembled's avatar Julien Muchembled

Make r21048 safer when calling render_view methods.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21052 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b648502c
......@@ -74,10 +74,10 @@ class DurationWidget(FormulatorPatch.IntegerWidget):
sub_value, value = divmod(value, convertion)
sub_field_render_list.append(self.render_sub_field_view(
field,sub_value, REQUEST))
field, sub_value, REQUEST=REQUEST))
# Render second
sub_field_render_list.append(self.render_sub_field_view(
field, value, REQUEST))
field, value, REQUEST=REQUEST))
return ':'.join(sub_field_render_list)
def render(self, field, key, value, REQUEST):
......@@ -102,7 +102,7 @@ class DurationWidget(FormulatorPatch.IntegerWidget):
Render dynamically a subfield
"""
return FormulatorPatch.IntegerFieldWidgetInstance.render_view(field, value,
REQUEST)
REQUEST=REQUEST)
def render_sub_field(self, field, key, value, REQUEST, keyword):
"""
......
......@@ -71,7 +71,7 @@ def Field_render(self, value=None, REQUEST=None, key=None):
def Field_render_view(self, value=None, REQUEST=None):
"""Render value to be viewed.
"""
return self.widget.render_view(self, value, REQUEST)
return self.widget.render_view(self, value, REQUEST=REQUEST)
def Field_render_sub_field(self, id, value=None, REQUEST=None, key=None):
"""Render a sub field, as part of complete rendering of widget in
......@@ -103,7 +103,7 @@ def Field_render_helper(self, key, value, REQUEST):
if self.get_value('hidden', REQUEST=REQUEST):
return self.widget.render_hidden(self, key, value, REQUEST)
elif (not self.get_value('editable', REQUEST=REQUEST)):
return self.widget.render_view(self, value, REQUEST)
return self.widget.render_view(self, value, REQUEST=REQUEST)
else:
return self.widget.render(self, key, value, REQUEST)
......@@ -417,7 +417,7 @@ class IntegerWidget(TextWidget) :
"""Render a non-editable interger."""
if isinstance(value, float):
value = int(value)
return TextWidget.render_view(self, field, value, REQUEST)
return TextWidget.render_view(self, field, value, REQUEST=REQUEST)
from Products.Formulator.StandardFields import IntegerField
......
......@@ -69,7 +69,7 @@ class ImageFieldWidget(Widget.TextWidget):
def render(self, field, key, value, REQUEST):
"""Render image field as a link to the image
"""
return self.render_view(field, value, REQUEST)
return self.render_view(field, value, REQUEST=REQUEST)
def render_view(self, field, value, REQUEST=None):
"""Render image field as a link to the image
......
......@@ -294,7 +294,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
XXX Improved rendering required
"""
html_string = self.default_widget_rendering_instance.render_view(
field, value, REQUEST)
field, value, REQUEST=REQUEST)
if REQUEST is None:
REQUEST = get_request()
relation_html_string = self.render_relation_link(field, value, REQUEST)
......
......@@ -140,7 +140,7 @@ class ParallelListWidget(Widget.MultiListWidget,
field.generate_subfield_key(sub_field_property_dict['key'],
key=key),
sub_field_property_dict['value'],
REQUEST)
REQUEST=REQUEST)
else:
result = self.sub_widget[sub_field_property_dict['field_type']].render_view(
field,
......
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