Hi Massimo,

> because developers are not supposed to use Rows.response which is an internal 
> variable
Maybe I have misunderstand something in the first version of your book
on site 146.

> What were you using response for?
Mainly to get custom dictionaries.

> If you post an example, I can help
> you move your code to the newest web2py.

The first example was in my first post:

> > result = db().select(db.reference.id, db.reference.l, db.reference.a, 
> > db.reference.b)
> > for i, l, a, b in result.response:
> >     c.reference(("lab"), l, a, b)

This could be rewritten like this:
for r in result:
    c.reference(("lab"), r.l, r.a. r.b)

Second example:
where = (db.interface.socket == db.socket.id) & (db.interface.host ==
db.device.id)
user   = db(where).select(db.interface.socket, db.device.netname)
for r in user.response:
        netuser[r[0]] = r[1]

And this like that:
for r in user:
        netuser[r.interface.socket] = r.device.netname

Well if I look to the new code it's much clearer what's going on here.

Martin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to