[Zope] ZSQL result passing

Arenz, Ralph Ralph.Arenz at friatec.de
Wed Mar 9 07:46:16 EST 2005


Try 
 <dtml-call "REQUEST.set('members',my_zsql_members_call())">
=> members will hold the recordsets.

..but, why don't you call the zsql-method within the
python-script like members=context.my_zsql_members_call() ?

ralph

 
 

-----Ursprüngliche Nachricht-----
Von: zope-bounces at zope.org [mailto:zope-bounces at zope.org]Im Auftrag von
burley at zonnet.nl
Gesendet: Mittwoch, 9. März 2005 13:27
An: zope at zope.org
Betreff: [Zope] ZSQL result passing


In a DTML method I'd like to pass the result from an ZSQL method to aPython
script. I've tried the following (which doesn't work but explainsmy idea):

Having a ZSQL my_zsql_members_call simply defined as:

    SELECT * FROM members;

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. 

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?

Thanks.

-- 
_____________________________________________________________________
Versatel ADSL Gratis. De voordelen van gratis internet met de
snelheid van ADSL. Zonder abonnementskosten en zonder vast contract.
Je betaalt alleen voor de tijd online. Nu zonder aansluitkosten en 
met gratis modem. Bestel snel op www.versatel.nl.

_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


More information about the Zope mailing list