[ZPT] Proposal: Change order, redocument and provide "finder"script

Fernando Martins fmartins@hetnet.nl
Fri, 24 Jan 2003 00:59:41 +0100


Troy Farrell wrote:
> 1. define
> 2. condition
> 3. repeat
>     a. repeat-define
>     b. repeat-condition
> 4. content or replace
> 5. attributes
> 6. omit-tag

I would say that what you want is really:

1. define
2. condition
3. repeat repeat_statement; define_vars_statements; condition_statement
4. content or replace
5. attributes
6. omit-tag

Example:

tal:repeat="item here/objectItems;
            key python: item[0];
            value python: item[1];
            python: item[1].date < expiration">

See also the posts
http://lists.zope.org/pipermail/zpt/2003-January/004268.html regarding the
problem of using a ';' as a delimiter.

Using a '@' instead of a ';' could increase legibility, like this:

tal:repeat="item here/objectItems @
            key python: item[0];
            value python: item[1] @
            python: item[1].date < expiration">

Another alternative would be to introduce tal:loop,

1. define
2. condition
3. repeat or loop
4. content or replace
5. attributes
6. omit-tag

where 'repeat' would stay put and 'loop' would be the extended 'repeat', to
be used as an exclusive alternative.

Regards,
Fernando