Suppose you do a query like this:

rows = db((db.a.id==db.foo.xx) &
(db.b.id==db.foo.yy)).select(db.foo.id, db.foo.aaa, db.a.name,
db.b.name, db.foo.zzz, ....)

And you want to processes the results generically, say to produce JSON
for input to jqGrid.  By generically, I mean not having to repeat the
"db.foo.aaa, db.a.name" stuff.  You know, DRY.

For r in rows:
   stuff...

What is the supported way of doing this?

Problems I see are:

   * You can't say: r[0] because row is a dict with keys 'a', 'b', and
'foo'.
   * You can't say: r[rows.colnames[0]] because, well, the same reason
as the previous item.

I see code in the Rows class like this:

           (t, f) = col.split('.')
                 if isinstance(record.get(t, None), (Row,dict)):
                        row.append(none_exception(record[t][f]))

But I wouldn't want to do that because it assumes the internal
structure of the Rows class...

Reply via email to