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

Fernando Martins fmartins@hetnet.nl
Fri, 24 Jan 2003 17:16:16 +0100


Shane Hathaway wrote:
> > > <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">
> > >

Wouldn't it be good enough to do

<tr tal:define="items here/getItems"
    tal:condition="options/itemize"
    tal:repeat="item items @
                name item/name; price item/price @
                python:name and price">

i.e., expand the grammar of tal:repeat to include any number of variable
definitions and a last condition.

repeat-define and repeat-condition are solving a problem which is related
only to tal:repeat. It should be solved inside tal:repeat.

If modifying the grammar of tal:repeat is not feasible, then an alternative
is to create a tal:loop with this expanded grammar.

Regards,
Fernando