[ZPT] CVS: Releases/Zope/lib/python/Products/PageTemplates/help - tal-repeat.stx:1.4.14.1

Florent Guillaume fg@nuxeo.com
14 Dec 2001 10:17:19 GMT


Evan wrote:
> +      o *first* - true for the first item in a group - see note below
> +      o *last* - true for the last item in a group - see note below

> +    Note that 'first' and 'last' are intended for use with sorted
> +    sequences.  They try to divide the sequence into group of items
> +    with the same value.  If you provide a path, then the value
> +    obtained by following that path from a sequence item is used for
> +    grouping, otherwise the value of the item is used.  You can
> +    provide the path by passing it as a parameter, as in
> +    "python:repeat['item'].first('color')", or by appending it to the
> +    path from the repeat variable, as in "repeat/item/first/color".

Hmmm, I'm not sure if this is used elsewhere, but wouldn't "isfirst" and
"islast" be a clearer name for these methods ? They return booleans
after all.


Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 10  http://nuxeo.com  mailto:fg@nuxeo.com