[web2py] Re: Accessing COUNT column from DAL row

2010-10-14 Thread Alex
Ahhh, that's exactly what it was... was missing the little apostrophes ('). The final syntax ended up being with the square brackets: {{=row['COUNT(game_session.createdBy)']}} Thank you very much for your help. On Oct 14, 8:06 pm, ron_m wrote: > Just add a > > print row > > before the =row(coun

[web2py] Re: Accessing COUNT column from DAL row

2010-10-14 Thread ron_m
Just add a print row before the =row(count) line and see what the structure of the row looks like from the console. It might be row['count'] depending on how your data is structured. On Oct 14, 5:20 pm, Alex wrote: > Hmm, I gave it a try on the view and it doesn't seem to like it. > > I'm doin

[web2py] Re: Accessing COUNT column from DAL row

2010-10-14 Thread Alex
Hmm, I gave it a try on the view and it doesn't seem to like it. I'm doing this on the view: {{for row in ranking:}} {{=row.auth_user.first_name}} {{=row.auth_user.last_name}} {{=row(count)}} {{pass}} and it's throwing a "name count is not defined" error. Am I still missing so

[web2py] Re: Accessing COUNT column from DAL row

2010-10-14 Thread Alex
Ahh thank you very much. I'll give it a try. If this is the case, then I believe the syntax example in the book/online is incorrect. Chapter 6 - DAL - Grouping and Counting section The book uses square brackets [] instead of parenthesis (). On Oct 14, 9:13 am, mdipierro wrote: > ok. You just

[web2py] Re: Accessing COUNT column from DAL row

2010-10-14 Thread mdipierro
ok. You just want for row in rows: print row.auth_user.first_name, row(count) On Oct 14, 6:17 am, Alex wrote: > Sure thing. > > I have something like: > >     count = db.game_session.createdBy.count() >     rankings = db((db.game_session.gameWinner == "1") & > (db.game_session.createdBy == > db.

[web2py] Re: Accessing COUNT column from DAL row

2010-10-14 Thread Alex
Sure thing. I have something like: count = db.game_session.createdBy.count() rankings = db((db.game_session.gameWinner == "1") & (db.game_session.createdBy == db.auth_user.id)).select(db.auth_user.first_name, db.auth_user.last_name, count, groupby=db.game_session.createdBy) return di

[web2py] Re: Accessing COUNT column from DAL row

2010-10-13 Thread mdipierro
show us the query. On Oct 13, 10:47 pm, Alex wrote: > Hello, > > I have a query that does a select and COUNT on my model.  I wish the > present the COUNT value of each row on the view but am having trouble > figuring out the syntax for doing this. > > I have a for loop, iterating through each row