[Zope] ZSQL method from python script

Peter Bengtsson mail@peterbe.com
Mon, 30 Jul 2001 15:27:40 +0200


just like in external methods.

for record in context.select_names_sql(name='peter'):
    print record.firstname + "<br>" + record.lastname


Or (but I'm not sure this is good practice but it works)

# if the SQL method returns only one record
recordset = context.select_names_sql(name='peter')
return recordset.firstname


Peter
    
----- Original Message ----- 
From: "Kerekes Lajos" <lkerekes@xperts.hu>
To: <zope@zope.org>
Sent: Monday, July 30, 2001 12:40 PM
Subject: [Zope] ZSQL method from python script


> Hello!
> 
> How can I call ZSQL method, from python script?
> And how can I use the result set of the ZSQL method?
> 
>    Thanks:
> 
>     Lajos Kerekes
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )