Commit 2f4e138b authored by Romain Courteaud's avatar Romain Courteaud

Make render_dict compatible with Proxyfield.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17162 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dcf220e4
......@@ -1302,3 +1302,21 @@ def TALESWidget_render_view(self, field, value):
return text
TALESWidget.render_view = TALESWidget_render_view
def Widget_render_dict(self, field, value):
"""
This is yet another field rendering. It is designed to allow code to
understand field's value data by providing its type and format when
applicable.
"""
return None
Widget.render_dict = Widget_render_dict
def Field_render_dict(self, value=None, REQUEST=None, key=None, **kw):
"""
This is yet another field rendering. It is designed to allow code to
understand field's value data by providing its type and format when
applicable.
"""
return self.widget.render_dict(self, value)
Field.render_dict = Field_render_dict
......@@ -941,9 +941,9 @@ class ListBoxRenderer:
search_field = listbox_form.get_field(editable_field_id)
else:
continue
render_dict = getattr(search_field.widget, 'render_dict', None)
render_dict = search_field.render_dict(search_value)
if render_dict is not None:
params[search_id] = render_dict(search_field, search_value)
params[search_id] = render_dict
# Set parameters, depending on the list method.
list_method_name = self.getListMethodName()
......
......@@ -120,6 +120,7 @@ class ProxyWidget(Widget.Widget):
render_view = WidgetDelegatedMethod('render_view', default='')
render_pdf = WidgetDelegatedMethod('render_pdf', default='')
render_css = WidgetDelegatedMethod('render_css', default='')
render_dict = WidgetDelegatedMethod('render_dict', default=None)
get_javascript_list = WidgetDelegatedMethod(
'get_javascript_list', default=[])
......
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