[web2py] Re: Displaying count and groupby PROBLEMS with new version

2014-04-11 Thread Derek
well, it looks like the changes from 2.8.2 to 2.9.5 did include changes to the 'count'... https://code.google.com/p/web2py/source/diff?spec=svn1cf7cc49ddcd5fd7169025477b8109fdfda0a5e5&r=1cf7cc49ddcd5fd7169025477b8109fdfda0a5e5&format=side&path=/gluon/dal.py On Wednesday, April 9, 2014 9:28:08 AM

[web2py] Re: displaying count and groupby

2014-04-02 Thread Fcosqui
This situation is so rare, I have the same problem with the current version, but I did not have this problem with version 2.8.2-stable + timestamp.2013.11.28.13.54.07 why can't i see a simple count like the prior version? . i use this sentence: rows = SQLTABLE(db(db.mydata.protocol=='udp').se

Re: [web2py] Re: displaying count and groupby

2014-03-31 Thread Dave S
On Thursday, March 27, 2014 6:27:17 AM UTC-7, Johann Spies wrote: > > On 27 March 2014 10:21, Dave S > wrote >> >> >> >> Except for one tiny detail. I don't want to print the results from the >> controller, I want the view to display them. >> >> > What about > > rows = SQLTABLE( db(db.table.i

[web2py] Re: displaying count and groupby

2014-03-31 Thread Dave S
On Thursday, March 27, 2014 9:23:14 AM UTC-7, Niphlod wrote: (My apologies for the delayed reaction ... I held off replying until I tried the changes.) > > . > return dict(rows=rows, count=count, groupby=groupby) > > > Thank you! I can now show the peak in February (for the current list o

[web2py] Re: displaying count and groupby

2014-03-27 Thread Niphlod
. return dict(rows=rows, count=count, groupby=groupby) On Thursday, March 27, 2014 9:21:01 AM UTC+1, Dave S wrote: > > > I know I'm a bit slow, but ... > > On Wednesday, March 26, 2014 4:21:27 PM UTC-7, Dave S wrote: >> >> On Wednesday, March 26, 2014 12:58:36 PM UTC-7, Niphlod wrote: >>>

Re: [web2py] Re: displaying count and groupby

2014-03-27 Thread Johann Spies
On 27 March 2014 10:21, Dave S wrote > > > > Except for one tiny detail. I don't want to print the results from the > controller, I want the view to display them. > > What about rows = SQLTABLE( db(db.table.id >0).select(count, groupby, groupby=groupby) > Johann -- Because experiencing your l

[web2py] Re: displaying count and groupby

2014-03-27 Thread Dave S
I know I'm a bit slow, but ... On Wednesday, March 26, 2014 4:21:27 PM UTC-7, Dave S wrote: > > On Wednesday, March 26, 2014 12:58:36 PM UTC-7, Niphlod wrote: >> >> assuming. >> >> count = db.table.id.count() >> groupby = db.table.birthday.month() >> >> #you can do >> >> rows = db(db.table.id

[web2py] Re: displaying count and groupby

2014-03-26 Thread Dave S
On Wednesday, March 26, 2014 12:58:36 PM UTC-7, Niphlod wrote: > > assuming. > > count = db.table.id.count() > groupby = db.table.birthday.month() > > #you can do > > rows = db(db.table.id >0).select(count, groupby, groupby=groupby) > for row in rows: > print row[count], row[groupby] > >

[web2py] Re: displaying count and groupby

2014-03-26 Thread Niphlod
assuming. count = db.table.id.count() groupby = db.table.birthday.month() #you can do rows = db(db.table.id >0).select(count, groupby, groupby=groupby) for row in rows: print row[count], row[groupby] i.e. the variables (count, groupby) you set are automatically "translated" to the "u

[web2py] Re: displaying count and groupby

2014-03-26 Thread Dave S
On Wednesday, March 26, 2014 1:08:04 AM UTC-7, Dave S wrote: (sorry about the formatting. GG was trying to out-wit me, and its success shows how easy that is to do.) > After browsing the sqlite docs, I figured out to count my bithdays per > month > for the table corresponding to the model >