What about putting the code snippet in a python script and then calling it from ZPT?<br><br>Put it in a script like "mycondition", and then<br><br><div tal:define="x here/mycondition"><br><!-- use x here -->
<br><br></div><br><br>Regards<br>Marco<br><br><br><div><span class="gmail_quote">On 12/5/06, <b class="gmail_sendername">Daniel de la Cuesta</b> <<a href="mailto:daniel.cuesta@iavante.es">daniel.cuesta@iavante.es
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
Hello,<br>
<br>
How can I insert a conditional python expresion inside a ZPT.<br>
<br>
Example:<br>
<br>
if (my_expresion):<br>
toreturn = a<br>
else:<br>
toreturn = b<br>
<br>
return toretun<br>
<br>
Thank you!<br>
<br>
<br>
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td>
<br>
<br>
<br>
<br>
</td>
</tr>
</tbody></table>
</div>
<br>_______________________________________________<br>Zope maillist - <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Zope@zope.org">Zope@zope.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">
http://mail.zope.org/mailman/listinfo/zope</a><br>** No cross posts or HTML encoding! **<br>(Related lists -<br> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">
http://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev
</a> )<br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Marco Bizzarri<br><a href="http://iliveinpisa.blogspot.com/">http://iliveinpisa.blogspot.com/</a>