Commit 1e2f23b7 authored by Nicolas Delaby's avatar Nicolas Delaby

Implement render_odt_view on IntegerField to cast value into string


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40519 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37cad69c
......@@ -1606,6 +1606,18 @@ class IntegerWidget(TextWidget) :
value = int(value)
return TextWidget.render_view(self, field, value, REQUEST=REQUEST)
def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name):
"""This renderer is dedicated to render values inside OOo document
It renderer convert explicitely numeric values into strings
"""
if isinstance(value, (int, float)):
# convert into string
value = '%s' % value
return TextWidget.render_odt_view(self, field, value, as_string,
ooo_builder, REQUEST, render_prefix,
attr_dict, local_name)
IntegerWidgetInstance = IntegerWidget()
class FloatWidget(TextWidget):
......
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