[ZPT] Extending tal:condition, making metal:define

ethan mindlace fremen mindlace@digicool.com
Fri, 06 Apr 2001 12:11:14 -0400


--On Friday, April 06, 2001 11:23:31 -0500 Guido van Rossum 
<guido@digicool.com> wrote:

> The general problem in this thread seems to be that TAL (like DTML?)
> doesn't have an "else" construct.

DTML has an else construct that almost always destroys the well-formedness 
of a page  and is a bit odd in that it is a singleton tag in a regular tag.

>  Could we add one, e.g. as follows:
>
>   <p tal:condition="exists:request/foo">Text if foo is set</p>
>   <p tal:else-condition="">Text if foo is not set</p>
>
> You could have any number of else-condition statements following a
> condition statement, just like Python's if...elif...elif...;

While something like this would be cool, I really, really want lazy 
inserts.  I'm tired of having to code around KeyErrors. Plus, how would you 
do else on tal:attributes?

--
ethan mindlace fremen
zopatista community liason