[ZPT] Mini proposal: repeat-define and repeat-condition

Richard Jones rjones@ekit-inc.com
Sat, 25 Jan 2003 12:04:59 +1100


On Sat, 25 Jan 2003 10:05 am, Evan Simpson wrote:
> Not only that, all five statements are quite likely to be useful on a
> single tag:
>
> <tr tal:define="items here/getItems"
>      tal:condition="options/itemize"
>      tal:repeat="item items"
>      tal:repeat-define="name item/name;price item/price"
>      tal:repeat-condition="python:name and price">
>
> How about calling them "define2" and "condition2" instead, and allowing
> them even in the absence of a tal:repeat?

+1 - but a nicer name would be preferrable. Happy to go with these if nothing 
better is suggested.

Hurm - you mention a condition3 tag. It really is too bad we can't process the 
TAL statements in the order they appear in the source. I just thought of a 
situation where it might be useful to have another define just after a 
condition2.

Then again, perhaps this stuff all belongs off in the model code (ie. Python 
Script) and we're simply asking too much of the view code?


     Richard