Hi guys, for this json service I'm using simplejson implicitly because the 
result of db.executesql
isn't serialized automatically by decorator, is this the normal behavior 
for db.executesql or something I'm missed here?
 
@auth.requires_login()
@service.json
def test_trackers():
    dthandler = lambda obj: obj.strftime('%d-%m-%Y %H:%M:%S') if isinstance(
obj, datetime.datetime) else None
    if auth.user_id == 1:
        events = db.executesql(GET_EVENT_ALL, as_dict=True)
    else:
        if session.customer_id:
            rows = db.executesql(GET_EVENT_BY_CUS % 
(session.customer_id),as_dict
=True)
            events = simplejson.dumps(rows, default=dthandler)
 
    return events

Error without using simplejson: Error 321 
(net::ERR_INVALID_CHUNKED_ENCODING): Unknown Error 

Greetings
Christian.

-- 

--- 
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/groups/opt_out.


Reply via email to