Here's the select output by the query causing the problem.  It looks 
exactly how I would right it.  So it must be right.  :-)

It seems to me that this new parse_datetime is broken.  The data sure 
doesn't look corrupt, and I can see how the old logic would work just fine 
on the data I printed.

SELECT  useinfo.sid, COUNT(useinfo.id), MAX(useinfo.timestamp) FROM useinfo 
WHERE (useinfo.course_id = 'devcourse') GROUP BY useinfo.sid ORDER BY 
COUNT(useinfo.id);

On Friday, August 31, 2012 3:29:55 PM UTC-5, Niphlod wrote:
>
> seems more a problem with returned values than a different form of select 
> .....
> can you please the output of res with the _select (mind the 
> underscore....) with both versions ?
>
> count = db.useinfo.id.count()
> last = db.useinfo.timestamp.max()
> res = db(db.useinfo.course_id==course.course_id)._select(
>         db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>
>
>
> On Friday, August 31, 2012 9:53:16 PM UTC+2, Brad Miller wrote:
>>
>> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
>> some of my pages got the following error:
>>
>> Traceback (most recent call last):
>>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
>> restricted
>>     exec ccode in environment
>>   File 
>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>> line 160, in <module>
>>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
>> <lambda>
>>     self._caller = lambda f: f()
>>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
>>     return action(*a, **b)
>>   File 
>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>> line 116, in studentactivity
>>     db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
>>     return adapter.select(self.query,fields,attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
>>     return super(SQLiteAdapter, self).select(query, fields, attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
>>     return self._select_aux(sql,fields,attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in 
>> _select_aux
>>     return processor(rows,fields,self._colnames,cacheable=cacheable)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
>>     fields[j].type,blob_decode)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in 
>> parse_value
>>     return self.parsemap[key](value,field_type)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
>> parse_datetime
>>     value,tz = value.split('-')
>> ValueError: too many values to unpack
>>
>> This is the result of this this query code, which continues to work under 
>> 1.99.7
>>
>>     count = db.useinfo.id.count()
>>     last = db.useinfo.timestamp.max()
>>     res = db(db.useinfo.course_id==course.course_id).select(
>>         db.useinfo.sid, count, last, groupby=db.useinfo.sid, 
>> orderby=count)
>>
>> I'm assuming this is some kind of regression since the same code is 
>> working in 1.99.7, but maybe I'm doing something that I could do  but no 
>> longer should??
>>
>> Brad
>>
>>

-- 



Reply via email to