Sorry for the long reply time (I am working at two jobs and didn't have time
to get to it yet).
I can supply the following simple example:
the data model is:
db.define_table("timestamps",
Field("by", db.auth_user),
Field("at", "datetime", default=request.now))
and the controller function is:
@service.jsonrpc
def test_json():
data = []
timestamps = db(db.timestamps.id > 0).select()
for ts in timestamps:
data.append(dict(by = ts.by.first_name, at = ts.at))
return data
When I try to call this from my application (qooxdoo app) I receive the
following JSONRPCError: "TypeError: datetime.datetime(2010, 11, 10, 10, 33,
22) is not JSON serializable". I think this is different from the behavior
in previous versions where I simply got a string back in return.
If I go to the test_json view directly through the browser I get the
following response:
{'2 {'at': 2 {'at': datetime.datetime(2010, 11, 10, 10, 56, 58), 'by':
'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 10, 58, 40), 'by':
'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 11, 44, 11), 'by':
'Andreas'} {'2 {'at': 2 {'at': datetime.datetime(2010, 11, 10, 11, 48, 17),
'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 11, 55, 12), 'by':
'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 11, 58, 7), 'by':
'Andreas'} {'2 {'at': 2 {'at': datetime.datetime(2010, 11, 10, 12, 7, 50),
'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 12, 17, 9), 'by':
'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 12, 20, 20), 'by':
'Andreas'}
I think it might be related to the detect_types change nick name has hinted
at. Am i right? I have tried to look through the Service class source to
understand if it uses as_list or not, but I haven't been able to ascertain
when a function receives the as_list attribute.
Any help would be greatly appreciated, and thanks for the extremely good
work on web2py (it seems I keep saying it, but it is really and truly
appreciated!)
Omri