[Zope] #in - current size

Oleg Broytmann phd@sun.med.ru
Tue, 12 Oct 1999 13:55:17 +0400 (MSD)


On Tue, 12 Oct 1999, Hannu Krosing wrote:
> > > Oleg said:
> > >
> > >    I have a loop:
> > > <!--#in images mapping start=qs size=10 orphan=1-->
> > >
> > >    How can I find the size of current batch? If, for example, there are
> > > 4
> > > images, I want to get 4. If there are 12, and it is 2nd batch, I want to
> > > get 2.

> Does'nt _.len or batch_size work ?

   len of WHAT :) I have no object to apply len! len(images) will give the
length of entire list (12, in my example).

   batch-size works only in prev/next batches, not current :(

> if not then DT_In.py (in Zope2/lib/python/DocumentTemplates) reveals the 
> following in its doc string - among other things , that should probably
> be 
> in "real" docs.
> 
>   'sequence-step-start-index' -- The index, starting from 0,
>              of the start of the current batch.
>   'sequence-step-end-index' -- The index, starting from 0, of
>              the end of the current batch. 
> 
> the size would probably be their difference ;)

   May be, I'll try it. Thanks.

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.