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').select(db.mydata.portid, 
db.mydata.portid.count(), orderby=db.mydata.portid, 
groupby=db.mydata.portid), headers={'mydata.portid':'Port 
Number:',str(db.mydata.portid.count()):'Times'}, orderby=True, 
_width="100%", truncate=1)

My view:
{{=row}}
{{pass}}

I can see just the Port number list with the current version and  Port 
Number + Times with 2.8.2-stable version.

El jueves, 27 de marzo de 2014 13:23:14 UTC-3, Niphlod escribió:
>
>
>
> .....
> 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:
>>>>
>>>> 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 "ugly format" you're referring to. 
>>>>
>>>
>>> Okay, that looks good.
>>>
>>
>>
>> Except for one tiny detail.  I don't want to print the results from the 
>> controller, I want the view to display them.  And when I do the for loop in 
>> the view,
>> I get a ticket for "NameError: name 'count' is not defined". How do I 
>> get the desired results from my controller to the view and out on the 
>> browser screen?
>>
>>  
>>>
>>>> This is the only recommended way to deal with those, because the 
>>>> row['_extra']["web2py_extract('month',person.birthdate)"]
>>>>
>>>> is only valid for a specific adapter (in this case, sqlite). This means 
>>>> that if you switch to mysql, it won't work.
>>>>
>>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to