[Zope] Batch-size problem

Hannu Krosing hannu@tm.ee
Thu, 25 Nov 1999 23:15:06 +0200


julio dinis wrote:
> 
> Hi Zopers,
> 
> I'm using the "in" tag vars to make an index on a large batch.
> 
> The list I'm iteracting with is created by me from an external method,
> and is something of the format:
> 
> [(1,2,3,abcd,5,6),(1,2,3,efgh,5,6),(1,2,3,4,ijkl,6)]
> 
> My problem is that this code:
> 
> <dtml-in mylist next size=2 start=qs>
>         <dtml-in next-batches mapping>
>                 [<dtml-var batch-size>]
>         </dtml-in>
> </dtml-in>
> 
> Is giving me this results:
> 
> [2]-[2]-[2]-[4]
> 
> Good for the firsts [2] results, but strangely outputs a [4] size for
> the last batch. This also happens, in reverse order, for the code I use to
> "previous" batches, i.e, [4]-[2]-[2]-[2].
> 
> Am I missing something?

There is an attribute called orphans (probably ;), that controls the number of 
orphaned items on last page. I think it defaults to >2 and so the last page of 
_only_ 2 items is appended to previous.

There is similar parameter for overlap too.

If you don't find it in docs then see the source ;-p

-----------------
Hannu