Commit 69a10af9 authored by Nicolas Delaby's avatar Nicolas Delaby

render_odg become render_odg_view then render_odg fallback on render_odg_view

So the rendering is the same.
Add sample of XML string representation in docstring in order to help future
developement.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40520 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e2f23b7
......@@ -226,6 +226,15 @@ class Widget:
def render_odg(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name):
"""This render dedicated to render fields inside OOo document
(eg. editable mode)
"""
# XXX By default fallback to render_odg_view
return self.render_odg_view(field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name)
def render_odg_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name):
"""
Default render odg for widget - to be overwritten in field classes.
Return a field node rendered in odg format.
......@@ -233,6 +242,16 @@ class Widget:
- attr_dict can be used for additional attributes (like style).
- ooo_builder wrapper of ODF zipped archive usefull to insert images
- local_name local-name of the node returned by this render
<draw:frame draw:name="my_string_field" draw:style-name="gr11"
draw:text-style-name="P5" draw:layer="layout"
svg:width="5cm" svg:height="0.725cm"
svg:x="6.5cm" svg:y="2.5cm">
<draw:text-box>
<text:p text:style-name="P5">
<text:span text:style-name="T4">my_string_field value</text:span>
</text:p>
</draw:text-box>
</draw:frame>
"""
if attr_dict is None:
attr_dict = {}
......
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