Re: [Zope] #in - current size
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html -Michel Oleg said: Hello! 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. Oleg.
Hi! Hmm, I have a copy of documentation locally (http://sun.med.ru/doc/Zope/), but there is no such section. In my version it is section 5.5. Seems you have updated the socs. Anyway, I cannot found the variable I need. There are previous-sequence-size and next-sequence-size, but there is no current-sequence-size :( sequence-step-size always give me 10... On Mon, 11 Oct 1999, Michel Pelletier wrote:
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html
Thanks, but this helped a little.
-Michel
Oleg said:
Hello!
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.
Oleg. ---- Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/ Programmers don't die, they just GOSUB without RETURN.
Oleg Broytmann wrote:
Hi!
Hmm, I have a copy of documentation locally (http://sun.med.ru/doc/Zope/), but there is no such section. In my version it is section 5.5. Seems you have updated the socs. Anyway, I cannot found the variable I need. There are previous-sequence-size and next-sequence-size, but there is no current-sequence-size :( sequence-step-size always give me 10...
On Mon, 11 Oct 1999, Michel Pelletier wrote:
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html
Thanks, but this helped a little.
-Michel
Oleg said:
Hello!
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 ? 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 ;) ----------------- Hannu
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.
Oleg Broytmann wrote:
There are previous-sequence-size and next-sequence-size, but there is no current-sequence-size :( sequence-step-size always give me 10...
You didn't notice 'batch-size'?
On Mon, 11 Oct 1999, Michel Pelletier wrote:
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html
-Michel
On Tue, 12 Oct 1999, Michel Pelletier wrote:
You didn't notice 'batch-size'?
On Mon, 11 Oct 1999, Michel Pelletier wrote:
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html
I noticed that abot batch-size: "Attributes of batch objects used when iterating over next-batches and previous-batches variables." I need the same thing for current batch, not next/prev... Oleg. ---- Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/ Programmers don't die, they just GOSUB without RETURN.
At 16:07 12/10/99 , Oleg Broytmann wrote:
On Tue, 12 Oct 1999, Michel Pelletier wrote:
You didn't notice 'batch-size'?
On Mon, 11 Oct 1999, Michel Pelletier wrote:
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html
I noticed that abot batch-size: "Attributes of batch objects used when iterating over next-batches and previous-batches variables." I need the same thing for current batch, not next/prev...
Maybe you could use the previous-sequence-end-index and next-sequence-start-index variables to calculate the current batch size.. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
On Tue, 12 Oct 1999, Martijn Pieters wrote:
At 16:07 12/10/99 , Oleg Broytmann wrote:
On Tue, 12 Oct 1999, Michel Pelletier wrote:
You didn't notice 'batch-size'?
On Mon, 11 Oct 1999, Michel Pelletier wrote:
http://www.zope.org/Documentation/Guides/DTML/DTML-HTML/DTML.6.5.html
I noticed that abot batch-size: "Attributes of batch objects used when iterating over next-batches and previous-batches variables." I need the same thing for current batch, not next/prev...
Maybe you could use the previous-sequence-end-index and next-sequence-start-index variables to calculate the current batch size..
Finally I used sequence-step-start-index/sequence-step-end-index. I looked them up in the sources and understant how they are calculated. Thanks. Oleg. ---- Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/ Programmers don't die, they just GOSUB without RETURN.
participants (4)
-
Hannu Krosing -
Martijn Pieters -
Michel Pelletier -
Oleg Broytmann