[Zope3-Users] test() in TALES in Zope3

Andreas Jung lists at andreas-jung.com
Wed Feb 1 03:07:17 EST 2006



--On 1. Februar 2006 09:04:36 +0100 Frank Burkhardt <fbo2 at gmx.net> wrote:

> Hi,
>
> in Zope2 there's a test() method that can be used in TAL (*). Is there
> something comparable in Zope3?
>
> I know how to write such a method but how to make it available in the
> namespace of TALES-"python:"-expressions? I would like to write
> expressions like this:
>
> <div tal:attributes="class python: 'foo' + test(condition == True,'
> bar','')" />
>

You can write this in Python as

    condition and true_expression or false_expression

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20060201/3fd5ea27/attachment.bin


More information about the Zope3-users mailing list