30 Jan
2004
30 Jan
'04
7:18 p.m.
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