[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-28 Thread Meinolf
Thanks Anthony, i understand clearly now, getcourseids was indeed a Rows object and it works now with just this line: s = db(db.item.id.belongs([c.item_id for c in getcourseids])).select(db.item .course_title) Thanks a lot really! On Wednesday, September 21, 2016 at 8:59:05 PM UTC+2, Anthony

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-21 Thread Anthony
On Wednesday, September 21, 2016 at 3:30:49 AM UTC-4, Meinolf wrote: > > OMG, Is this normal? > i got chills telling me it had something to do with the *For Loop*, > played around with the LBs and UBs and the following worked: > >* for i in range(-1, (len(getcourseids)-1)):* > First,

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-21 Thread Dave S
On Wednesday, September 21, 2016 at 12:30:49 AM UTC-7, Meinolf wrote: > > OMG, Is this normal? > i got chills telling me it had something to do with the *For Loop*, > played around with the LBs and UBs and the following worked: > >* for i in range(-1, (len(getcourseids)-1)):* >

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-21 Thread Meinolf
OMG, Is this normal? i got chills telling me it had something to do with the *For Loop*, played around with the LBs and UBs and the following worked: * for i in range(-1, (len(getcourseids)-1)):* * c = db.item.id==getcourseids[i].item_id* *

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-21 Thread Meinolf
I tried both approaches but i get the following error: 'Rows' object has no attribute 'values' the Rows object being referred to in the error is *getcourseids, *which is true because it holds a set of rows retrieved from the database before. How can i get around it then? On Tuesday, September

[web2py] Re: Passing a list as query parameter and storing the retrieved rows in a list

2016-09-20 Thread villas
Maybe you could better use more of the power of web2py. Something like this? s = db( db.item.id.belongs(getcourseids.values()) ).select( db.item.course_title).as_list() or perhaps a bit longer, something like this... rows = db( db.item.id.belongs(getcourseids.values())