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
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
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
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
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.
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
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
7 matches
Mail list logo