[Zope] dtml-in and batches

Michel Pelletier michel@digicool.com
Fri, 17 Sep 1999 12:00:22 -0400


> -----Original Message-----
> From: Duncan Booth [mailto:duncan@rcp.co.uk]
> Sent: Friday, September 17, 1999 12:20 PM
> To: Michel Pelletier
> Subject: RE: [Zope] dtml-in and batches
> 
> > > I may be missing something obvious here, but if I use the 
> in tag to 
> > > iterate over a list in several batches, how can I easily work 
> > > out what 
> > > *all* the batches are.
> > 
> > Get the _.len(ObjectValues(...)) and divide by your batch size.
> > 
> > -Michel
> As I understand it, the last batch can be longer than the batch size, 
> but this solution won't cope with that.

No batch will be bigger than the batch size.  If anything, the last
batch will be smaller, but it will be the size of the remainder of
dividing the total result set length by the batch size.

-Michel