> if (my_expresion):
>     toreturn = a
> else:
>     toreturn = b
>
> return toretun
Try:
tal:define="toreturn python: my_expression and a or b"

but you need to be aware that 'a' has to be logical True
in context of this statement (if a may be 0 or '' then this
may fail).

or
tal:define="toreturn python: test(my_expression,a, b)"

-- 
Maciej Wisniowski
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to