proposal: @expose('jsondebug')

0 views
Skip to first unread message

Jorge Vargas

unread,
Dec 2, 2008, 1:52:45 PM12/2/08
to turbogea...@googlegroups.com
Hello guys, I have been working with a heavy ajaj app (I hate that
name), and I find myself doing this a lot, when debugging.

changing
@expose('json')
to
@expose()

changing return type to str, in order to see the actual json stream on
the browser window.

so why not have a @expose('jsondebug') that will
1- set content type to text (so browsers will display instead of download)
2- pretty print the json obj, so we will get structure instead of a single line
3- ???

what do you think?

Sanjiv Singh

unread,
Dec 2, 2008, 2:01:35 PM12/2/08
to turbogea...@googlegroups.com
Hi Jorge,

That would be really cool.

Regards
Sanjiv

Remi Jolin - SysGroup

unread,
Dec 2, 2008, 2:51:53 PM12/2/08
to turbogea...@googlegroups.com
Yes, it would be helpful...
Why not using a syntax like
@expose('json', format='debug')
so you could setup a global variable like json_debug = None | 'debug'
ans pass it to all the @expose('json', format=json_debug)

Daniel Fetchinson

unread,
Mar 29, 2009, 1:17:42 AM3/29/09
to turbogea...@googlegroups.com

This problem can be solved by installing the JSONView Firefox plugin.
It will render the json response with syntax highlighting, folding and
indentation. No need to introduce anything to tg.

https://addons.mozilla.org/en-US/firefox/addon/10869/

Cheers,
Daniel

--
Psss, psss, put it down! - http://www.cafepress.com/putitdown

Reply all
Reply to author
Forward
0 new messages