[ZPT] Add 'parity' to repeat?

Shane Hathaway shane at zope.com
Mon Aug 25 17:39:35 EDT 2003


Evan Simpson wrote:
> The use of "python:test(path('repeat/thing/odd'), 'odd', 'even')" and 
> variants has become so common as to merit its own method.
> 
> I suggest that 'parity()' be added to the stock repeat object.  It would 
> return the string "odd" or "even", depending on the repetition index.
> 
> This would allow the nicely concise:
> 
>   <tr tal:attributes="class repeat/row/parity">

I forgot to mention in the first reply that I'm in favor of adding 
parity() to the stock repeat object, regardless of subpath prefixes.

Shane




More information about the ZPT mailing list