Is it possible to update a Rows object with another Rows object?

17 views
Skip to first unread message

João Matos

unread,
Apr 16, 2019, 11:11:09 AM4/16/19
to web2py-users
Is it possible to update a Rows object with another Rows object?

I would like to do something similar to this (except that update does not exist in Rows)

rows = db(db.wo.id == int(request.args[0])).select()
if len(request.args) > 1:
   
for id_ in request.args[1:]:
        rows
.update(db(db.wo.id == int(id_)).select()

João Matos

unread,
Apr 16, 2019, 3:42:52 PM4/16/19
to web2py-users
The solution is simply to add them :)

Got help in the Telegram Web2py International Support Group at https://t.me/web2py_world/

Anthony

unread,
Apr 16, 2019, 4:51:03 PM4/16/19
to web2py-users
Why not a single query to get all records:

rows = db(db.wo.id.belongs(request.args)).select()

Anthony
 

João Matos

unread,
Apr 16, 2019, 4:52:56 PM4/16/19
to web2py-users
Thanks Anthony. I found out about belongs after posting.
Reply all
Reply to author
Forward
0 new messages