[Zope] ZSQL methods & results lists

Dieter Maurer dieter@handshake.de
Mon, 23 Jul 2001 23:24:14 +0200 (CEST)


Garry Steedman writes:
 > i have a ZSQL method called get_clients....
 > <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?
Unless your Z SQL method has a brain with a "__call__" method,
you should be able to access the field names.
Otherwise, you need to use "_.getitem('sequence-item')".

But why do you want to implement batching while "dtml-in"
has it already?


Dieter