Relatorio: choose, when, and others

Hi all,

I just started looking into relatorio and I read in the documentation:

In this example, we only used the py:for directive, but Relatorio also supports other Genshi directives: py:if, py:choose / py:when / py:otherwise and py:with.

However, I cannot get a choose - when clause into my odt document.

I tried adding fields (Ctrl+F2) comprising
<choose=“”>
<when=“o.total <= 100”>
<when=“o.total > 100”>

I also tried with closing tags. With the above, I get the error:

TypeError: escape_xml_invalid_chars() got an unexpected keyword argument ‘choose’

Could anybody please give an example? Or is this not supported?

Thank you!
Dom Ca

It should be:

<choose>
<when test="o.total <= 100">
</when>
<when test="o.total > 100">
</when>
</choose>

or even better:

<choose>
<when test="o.total <= 100">
</when>
<otherwise>
</otherwise>
</choose>

Hi Cedric,

Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.