Chris McDonough
2011-04-18 a7b1a933a263ee99426fda642c379d942f8f852b
refs
author Chris McDonough <chrism@plope.com>
Monday, April 18, 2011 23:07 +0200
committer Chris McDonough <chrism@plope.com>
Monday, April 18, 2011 23:07 +0200
commita7b1a933a263ee99426fda642c379d942f8f852b
tree caf62972651e16e398f15c9486dee9f22be3eceb tree | zip | gz
parent 6f0805ec33252d391338972eaadea25262b6d71c view | diff
- 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).
9 files modified
394 ■■■■ changed files
CHANGES.txt 30 ●●●●● diff | view | raw | blame | history
docs/api/request.rst 42 ●●●●● diff | view | raw | blame | history
docs/narr/renderers.rst 74 ●●●●● diff | view | raw | blame | history
docs/narr/templates.rst 14 ●●●● diff | view | raw | blame | history
pyramid/renderers.py 46 ●●●● diff | view | raw | blame | history
pyramid/request.py 22 ●●●●● diff | view | raw | blame | history
pyramid/testing.py 24 ●●●● diff | view | raw | blame | history
pyramid/tests/test_renderers.py 97 ●●●● diff | view | raw | blame | history
pyramid/tests/test_testing.py 45 ●●●●● diff | view | raw | blame | history