summaryrefslogtreecommitdiff
path: root/docs/narr/templates.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-04-18 17:07:38 -0400
committerChris McDonough <chrism@plope.com>2011-04-18 17:07:38 -0400
commita7b1a933a263ee99426fda642c379d942f8f852b (patch)
treecaf62972651e16e398f15c9486dee9f22be3eceb /docs/narr/templates.rst
parent6f0805ec33252d391338972eaadea25262b6d71c (diff)
downloadpyramid-a7b1a933a263ee99426fda642c379d942f8f852b.tar.gz
pyramid-a7b1a933a263ee99426fda642c379d942f8f852b.tar.bz2
pyramid-a7b1a933a263ee99426fda642c379d942f8f852b.zip
- Deprecated all assignments to ``request.response_*`` attributes such as
``request.response_content_type = 'foo'``. Assignments and mutations of the following request attributes that were considered by the framework for response influence are now deprecated: ``response_content_type``, ``response_headerlist``, ``response_status``, ``response_charset``, and ``response_cache_for``. Instead of assigning these to the request object for detection by the rendering machinery, users should use the appropriate API of the Response object created by accessing ``request.response`` (e.g. ``request.response_content_type = 'abc'`` -> ``request.response.content_type = 'abc'``). - Custom request objects are now required to have a ``response`` attribute (or reified property) if they are meant to be used with renderers. This ``response`` attribute should be an instance of the class ``pyramid.response.Response``. - The JSON and string renderer factories now use ``request.response.content_type`` rather than ``request.response_content_type``. They determine whether they should set the content type of the response by comparing the response's content type against the default (usually ``text/html``); if the content type is not the default, the renderer changes the content type (to ``application/json`` or ``text/plain`` for JSON and string renderers respectively). - Made it possible to assign to and delete ``pyramid.testing.DummyRequest.registry`` (bugfix).
Diffstat (limited to 'docs/narr/templates.rst')
-rw-r--r--docs/narr/templates.rst14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst
index 426ec229b..150b173e3 100644
--- a/docs/narr/templates.rst
+++ b/docs/narr/templates.rst
@@ -367,13 +367,13 @@ templates as renderers. See :ref:`available_template_system_bindings`.
render a view without needing to fork your code to do so. See
:ref:`extending_chapter` for more information.
-By default, views rendered via a template renderer return a
-:term:`Response` object which has a *status code* of ``200 OK``, and a
-*content-type* of ``text/html``. To vary attributes of the response
-of a view that uses a renderer, such as the content-type, headers, or
-status attributes, you must set attributes on the *request* object
-within the view before returning the dictionary. See
-:ref:`response_request_attrs` for more information.
+By default, views rendered via a template renderer return a :term:`Response`
+object which has a *status code* of ``200 OK``, and a *content-type* of
+``text/html``. To vary attributes of the response of a view that uses a
+renderer, such as the content-type, headers, or status attributes, you must
+use the API of the :class:`pyramid.response.Response` object exposed as
+``request.response`` within the view before returning the dictionary. See
+:ref:`request_response_attr` for more information.
The same set of system values are provided to templates rendered via a
renderer view configuration as those provided to templates rendered