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

Shane Hathaway shane@zope.com
Sat, 25 Jan 2003 09:35:07 -0500 (EST)


On Sat, 25 Jan 2003, Richard Jones wrote:

> 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.

"rdefine" and "rcondition", perhaps.

> 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?

If you go off in the direction of "condition3", yes, you're asking too 
much of TAL.  Let's not increase its complexity.

Since no resources are available to do this anyway, though, we can 
probably drop the idea for now.

Shane