[Zope] ZSQL methods & results lists
Garry Steedman
gs@styrax.com
Mon, 23 Jul 2001 14:46:36 +0000
Hello all,
i have a ZSQL method called get_clients. i want to put the results of
this method into a list called results. if i then slice that list
(using the variable batch_size) i want to create a new list called
results_temp which i then use for displaying the result set.
here is my code:
<dtml-unless batch_size>
<dtml-call expr="REQUEST.set('batch_size',20)"></dtml-unless>
<dtml-unless skey>
<dtml-call expr="REQUEST.set('skey', 'NOM')"></dtml-unless>
<dtml-unless rkey>
<dtml-call expr="REQUEST.set('rkey', '')"></dtml-unless>
<dtml-unless results>
<dtml-call "REQUEST.set('results', [])">
<dtml-in get_clients sort=NOM>
<dtml-call"results.append(_['sequence-item'])">
</dtml-in>
</dtml-unless>
<dtml-if expr="batch_size!=20"><dtml-var batch_size>
<dtml-call "REQUEST.set('results_temp', [results[:batch_size]])">
<dtml-else>20
</dtml-if>
i am a bit stuck with the following issue: i cant seem to call the
field names associated with the ZSQL method. i think the problem is
the way im using sequence-item, but i cant find a workaround: anyone
have any suggestions?
cheers,
Garry
+-------------------------------------------+
Garry Steedman mailto:gs@styrax.com
Styrax Associates http://www.styrax.com/
"The Good Man has no shape."
+-------------------------------------------+