You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's probably convenient for some code paths to be able to leave out the request argument to pyramid.renderers.render_to_response. The docs carry as a sort of warning:
Supply a request parameter in order to provide the renderer with the most correct 'system' values (request and context in particular).
In my call to render, I didn't provide the request default argument, and was surprised to find out that writes to request.response attributes (such as request.response.content_type = 'foo') had no effect on the response produced by render_to_response.
I think either 1) the docs should be updated to be more clear about the consequences instead of "most correct system values", or ideally 2) the request argument to render_to_response be made required.
The text was updated successfully, but these errors were encountered:
Render templates at module scope, sure. But render them to response on a module level?
Not sure if I'm assuming correctly that only render_to_response is a problem here, and not render. If I'm correct, then it feels like request should be a required for that particular function.
It's probably convenient for some code paths to be able to leave out the
request
argument topyramid.renderers.render_to_response
. The docs carry as a sort of warning:In my call to render, I didn't provide the request default argument, and was surprised to find out that writes to
request.response
attributes (such asrequest.response.content_type = 'foo'
) had no effect on the response produced byrender_to_response
.I think either 1) the docs should be updated to be more clear about the consequences instead of "most correct system values", or ideally 2) the
request
argument torender_to_response
be made required.The text was updated successfully, but these errors were encountered: