[zope-news] Fw: Re: [ZPT] Mini proposal: repeat-define and repeat-condition

Troy Farrell troy at entheossoft.com
Thu Jan 23 11:18:55 EST 2003


The situation gets more interesting as Casey proposes another solution 
to our zpt woes(1) ...  I think this could be added to the news report...

1) http://lists.zope.org/pipermail/zpt/2003-January/004247.html

Troy

-------- Original Message --------
Subject: Re: [ZPT] Mini proposal: repeat-define and repeat-condition
From: Casey Duncan

On Tuesday 21 January 2003 09:16 pm, Shane Hathaway wrote:
 > Evan Simpson wrote:
 >
 >>>> I had propsed changing the order of operations from "define,
 >> condition,
 >>>> repeat, etc." to "repeat, define, condition, etc.", and using a
 >>>>  processing instruction in a similar fashion to Python's
 >>>> "import
from
 >>>> __future__".
 >
 > +1 from me.  It's better than my proposal.

Here's a counter-proposal that I think might combine both of yours and
solve the backward compatibility issue:

Invent a new repeat tag that happens first and leave the existing repeat
tag alone.

This tag would not be understood by older TAL processors, but it would 
not break any existing page templates or harm those blissfully ignorant 
of the change.

Something like:

<div tal:pre-repeat="item here/foo" tal:define="ob item/getObject">

Another similar but more general idea would be to invent some way to
specify in a tag that you wanted it to happen before other TAL tags. A 
stupid way that comes to mind would be to invent a new namespace. 
Another would be to introduce a flag in the attribute value that says 
"do me first". I'm not sure how we would spell this though.

For example:

<div pretal:repeat="item here/foo" tal:define="ob item/getObject">

All "pretal" tags get evaluated before "tal" tags (but using the same 
order within that namespace as within tal).

-Casey





More information about the Zope-News mailing list