db.executesql return a sql table object with no represent and other web2py
fancy stuff (row_delete, id, etc.).

I think you will have to translate the Niphold SQL into "web2py query",
like db(...).select(...)

Richard


On Tue, Feb 19, 2013 at 2:21 PM, Christian Espinoza <[email protected]>wrote:

> 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') ifisinstance
> (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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to