Re: [pylons-discuss] How to enable JSON renderer as default for all views?

2017-11-06 Thread Michael Merickel
Jens, I'm happy to review a PR. Also you are correct that if you return `None` then the json renderer will kick in and use request.response. As far as how this works with certain responses such as 201, 202, etc you will probably want to be careful and return an explicit Response object in some

Re: [pylons-discuss] How to enable JSON renderer as default for all views?

2017-11-06 Thread jens . troeger
Thanks Michael! Would you like me to submit a PR for the adjusted comment as per your suggestion? All of my (Cornice) view functions are decorated like so: @some_service.post( content_type="application/json",

Re: [pylons-discuss] How to enable JSON renderer as default for all views?

2017-11-01 Thread Michael Merickel
This renderer feature does not override the other one which is "if you return a Response object then no renderers will be invoked". HTTPOk is a Response subclass. This is covered in the first few paragraphs of the renderer chapter. I'd be open to a PR that clarified the docs on this in the section

[pylons-discuss] How to enable JSON renderer as default for all views?

2017-11-01 Thread jens . troeger
Hello, The documentation for the default renderer for all views seems to suggest that the following should work: from pyramid.renderers import JSON config = Configurator( … )