[Zope] Dynamic ZSQL method - almost there
Dieter Maurer
dieter at handshake.de
Fri Jan 30 14:18:50 EST 2004
Kashif Jabbar wrote at 2004-1-29 22:28 -0600:
> ...
>for row in context.mysql(params={'name':{'op':'=','val':'John Doe'}}):
> print row
>return printed
>
>When I run the script I get a message as follows:
>
><r instance at 015C5760>
This is as it should look like:
A Z SQL Method (performing a "select") returns a
sequence of "r instances".
Each such "r" ("row") instances represents one row
of the result.
An "r" instance has the fields of the result row as attributes.
E.g. when you use "select a, b, c ..." then
you can access the fields by "r.a", "r.b", "r.c", ...
You can also access the fields by subscription "r[0]", "r[1]", ...
--
Dieter
More information about the Zope
mailing list