[ZPT] accessing "repeat" variables

Michal Kurowski michal@genesilico.pl
Tue, 2 Jul 2002 19:50:49 +0200

Thanks to all the people contributing to the "batching" thread
(specially C. Duncan). I've rather sorted out about SESSION and such.
I'm still having problems though ;-).

How actually shall we access variables in the tal:repeat statements ?

Is it possible to use them as arguments to outer scripts/templates ?

Let's say I've got this:

<div tal:repeat="result batch">


      <td><span tal:replace="result/job_id">job_id goes
      <td><a tal:attributes="href string:
      ${here/classic/redirect/absolute_url}?arg=${result/job_id}"><span tal:replace="python: result.job_name or default"><i>not given</i></span></a></td>
      <td><span tal:replace="result/host">host goes here</span></td>
      <td><span tal:replace="result/born">born goes here</span></td>
      <td><span tal:replace="structure python: here.display_status(status)">status goes here</span></td>
      <td><span tal:replace="result/len">len goes here</span></td>


I'd like to use the "result" (which is and ZSQL method result instance)
in some other ZPT to access all the fields from the iteration so I
don't have to repeat this particular query. I tried various way but
ended up with direct "${result/job_id}".

Comments ?

Michal Kurowski