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
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,
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)):*
>
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*
*
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
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())
6 matches
Mail list logo