[Zope] Re: TAL: test() or condition Howto? solved!!!

Elena Schulz elena.schulz@gmx.net
Fri, 31 Jan 2003 17:52:03 +0100


Hi Evan,

BINGO, that's it --- just when I was getting familar with the idea of
adopting one more cute python-thingy your idea came along. I knew it should
be possible :), but the idea of putting the condition in the define-slot is
just exellent and makes it.
My zen of python has increased one step further, thanks a lot.

May this one should be mentioned at zope-labs. (you get a 5 star-rating from
my side)

-- thanks again, Elena


> Thanks to the way Python's "and" works, you can do the following:
>
> <td tal:define="x python:myImportantCondition and myExpensiveMethod()"
>      tal:content="python:x or default">myDefaultString</td>