Re: [Zope] Calling ZSQL methods with implicit arguments
However simple this looks, it seems that when I use the ZSQL method >inside an expression I must use Explicit arguments, meaning I can't >do something like
<dtml-let results="myZsqlMethod"> ... </dtml-let>
Are you sure? This should be possible. What traceback do you get? What do you want to store? The records from the zsqlmethods or the zsqlmethod Results object, i.e, one list of <r instance at xyz> instances or a <Shared.DC.ZRDB.Results.Results instance at xyz> instance? Another Option (store <Shared.DC.ZRDB.Results.Results instance>) : <dtml-call "REQUEST.set('Results',MyZsqlMethod)"> ... and later.... <dtml-in Results> ... </dtml-in> Another Option (store a list of <r instance>): <dtml-call "REQUEST.set('results',[])"> <dtml-in MyZsqlMethod> <dtml-call "results.append(_['sequence-item'])"> </dtml-in> ..later.. <dtml-in results> ... </dtml-in> Regards, Julio Silva _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Em Quinta, 24 de Janeiro de 2002 16:07, Júlio Dinis Silva escreveu:
<dtml-let results="myZsqlMethod"> ... </dtml-let>
Are you sure? This should be possible. What traceback do you get?
The "let" by itself works, but it doesn't store the Results just the ZSQL method itself (i.e., if i try results[0] I get a traceback).
Another Option (store <Shared.DC.ZRDB.Results.Results instance>) : <dtml-call "REQUEST.set('Results',MyZsqlMethod)">
This is the same thing.
<dtml-call "REQUEST.set('results',[])"> <dtml-in MyZsqlMethod> <dtml-call "results.append(_['sequence-item'])"> </dtml-in>
This might do the trick, but I prefer Ulli's way :-) Nuno
participants (2)
-
J�lio Dinis Silva -
Nuno Maltez