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

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


Hi Dylan, Ivo, Max and Andre,

I was in the hope that there would be an elegant zpt-way of doing this. So
it seems that I have to do it with python. Hmm, slowly I get quite a bunch
of those tiny little pythons snailing around. Maybe it should be done
generally as a specific test-function for all decisions of this
lazy-evaluation-kind.
Its a pity that there is no easy '|' construct like in path-expressions.

-- thanks for your answers, Elena


> At 06:33 AM 1/31/2003, Ivo van der Wijk wrote:
> >My advice would be to use a pythonscript.
>
> Ditto to that... it's trivial in Python:
>
> if myImportantCondition:
>     return myExpensiveMethod or myDefaultValue
> return myDefaultValue
>
> Where those tokens are expanded into something meaningful, of course...
:-)
>
> Dylan
>