[Zope] how to store ZSQL query results in a python var

Andreas Jung lists at andreas-jung.com
Thu Apr 7 07:20:16 EDT 2005



--On Donnerstag, 7. April 2005 4:10 Uhr -0700 prabuddha ray 
<buddharay at gmail.com> wrote:

> from a newbie,
>         i've this ZSQLmethod returning me a string  only. how do i
> store it a var in my python script.
> eg., userlevel = container.getUserLevel(uname=user)
>
> when i print it using html_quote as :
>    print "(%s)" % html_quote(userlevel)
>         return printed
> output is :
>      (&lt;Shared.DC.ZRDB.Results.Results instance at 0x41dd966c&gt;)

The RDBMS chapter of the Zope Book that call a ZSQL method returns
something that behaves like a list of rows. That's what you see when
you look at the output. Accessing and working with ZSQL methods
is carefully described in the Zope Book (2.7 edition) - isn't it?

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050407/76575bbf/attachment.bin


More information about the Zope mailing list