On Sep 24, 10:09 am, Jonathan Vanasco <[email protected]> wrote:
> > Jsonify is only ten lines or so.  You can copy it and add this
> > feature.  It's too specific for Pylons though.  (What would the config
> > variable be, 'jsonify_content_type'?)
>
> I disagree that its too specific.  It's a change that would make it
> easier for developers to test jsonify content in their browser,
> without having to use firefox with a special plugin -- which is what
> people currently have to do.  I think making things easier for a
> general audience of Pylons developers to code & test is good.
>
> I don't need this personally.  I use a library function to create
> structured dicts that are turned into JSON , and put this
> functionality in there.  But I do think it is of benefit to others.
>
> And yes, I was thinking of a change like this :
>
> -    pylons.response.headers['Content-Type'] = 'application/json'
>
> +    if 'pylons.jsonify_content_type' in pylons.config:
> +        pylons.response.headers['Content-Type'] = pylons.config
> ['pylons.jsonify_content_type']
> +    else:
> +        pylons.response.headers['Content-Type'] = 'application/json'

I'm -0 on this idea, but if it goes in, I'd prefer this
implementation:

 -    pylons.response.headers['Content-Type'] = 'application/json'
 +   pylons.response.content_type = config.get('json_content_type',
'application/json')

I don't think the JSONView Firefox add-on qualifies as particularly
"special", and the formatting & colorization is very nice. When I've
viewed JSON as text in the browser, it's been nearly unreadable
because it was all squished together & didn't wrap.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to