[Zope] ZSQL result passing

Henk Jansen burley at zonnet.nl
Wed Mar 9 15:40:26 EST 2005


On Wed, 2005-03-09 at 19:28, Dieter Maurer wrote:
> burley at zonnet.nl wrote at 2005-3-9 13:26 +0100:
> > ...
> >I'd hoped that in:
> ><dtml-let members=my_zsql_members_call>
> >
> >   <dtml-in my_zsql_iterator_call prefix="seq">
> >        <dtml-var my_python_call(item=seq_item,members=members)>
> >  </dtml-in>
> >
> ></dtml-let>
> >
> >the my_zsql_members_call would return a *list* of multiple rows (or kind
> >ofsequence object) of members information data to be used thereafter in the
> ><dtml-in> iteration. Obviously, this is not the case. 
> 
> It should indeed.
> 
> However, the code above calls your Z SQL Method twice (a waste of time!).

Note that the two calls are different (a ZSQL call en Python call,
respectively).

> Use "<dtml-in members ...>" instead (this has nothing to do with
> your problem, it is just a sidenote).

This would iterate over the members, which I don't want. The entire
members list should be made available to the my_python_call function.

> 
> >Technically, my problem can simply be restated as follows: how do I retrieve a
> >multiple row ZSQL result and bind it to a single variable so that it can be
> >passed to and iterated upon in a Python script?
> 
> The code above should do this.
> 
> What (precise!) kind of problem you observe (error type, error value
> and traceback!)

I don't get any error at all! In the python script the members parameter
is just equal to its default argument "" (i.e. an empty string).

Conclusion: although it's all legal DTML code, the <dtml-let> statement,
however, doesn't do anything.



More information about the Zope mailing list