To do that I have an outer iteration
over sqlCount's results: In this case it would iterate 3 times.
Within each iteration there's another iteration - and this 2nd one depends
on the current row's Count (2 times in the 1st outer
iteration, 1 time in the 2nd iteration etc.).
To print out the projects within the inner iteration I use the
following technique:
<dtml-in "sqlCount(_.None,_)"> //outer
iteration!
<dtml-if sequence-start>
<dtml-call
"REQUEST.set('TEMP',1)">
</dtml-if sequence-start>
<dtml-call "REQUEST.set('TEMP2',
(TEMP+_.getitem('Count'))-1)">
<dtml-in DATA start=TEMP
end=TEMP2> //inner
iteration
//Print
ProjectIDs here
</dtml-in>
<dtml-call
"REQUEST.set('TEMP', TEMP+(_.getitem('Count')))">
</dtml-in>
It may take some time to understand the code but it actually
works as it should. I simply would prefer a cleaner solution where I would
avoid the creation of different variables via REQUEST.set (which are then
used in <dtml-in DATA start=VARIABLE)
but simply do the calculation within the "start=" and
"end="
Was that still a bad description of my problem?
Thanks again,
Philipp Robbel