summaryrefslogtreecommitdiff
path: root/docs/narr/webob.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-06-11 05:35:27 -0400
committerChris McDonough <chrism@plope.com>2011-06-11 05:35:27 -0400
commit99edc51a3b05309c7f5d98ff96289ec51b1d7660 (patch)
treec8ddaa62b21c54eb996f5e375abd5bf9f5198806 /docs/narr/webob.rst
parentdf15ed98612e7962e3122da52d8d5f5b9d8882b2 (diff)
downloadpyramid-99edc51a3b05309c7f5d98ff96289ec51b1d7660.tar.gz
pyramid-99edc51a3b05309c7f5d98ff96289ec51b1d7660.tar.bz2
pyramid-99edc51a3b05309c7f5d98ff96289ec51b1d7660.zip
- Pyramid now expects Response objects to have a __call__
method which implements the WSGI application interface instead of the three webob attrs status, headerlist and app_iter. Backwards compatibility exists for code which returns response objects that do not have a __call__. - pyramid.response.Response is no longer an exception (and therefore cannot be raised in order to generate a response). - Changed my mind about moving stuff from pyramid.httpexceptions to pyramid.response. The stuff I moved over has been moved back to pyramid.httpexceptions.
Diffstat (limited to 'docs/narr/webob.rst')
-rw-r--r--docs/narr/webob.rst23
1 files changed, 12 insertions, 11 deletions
diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst
index 6cd9418ce..70ab5eea8 100644
--- a/docs/narr/webob.rst
+++ b/docs/narr/webob.rst
@@ -362,20 +362,21 @@ To facilitate error responses like ``404 Not Found``, the module
:mod:`webob.exc` contains classes for each kind of error response. These
include boring, but appropriate error bodies. The exceptions exposed by this
module, when used under :app:`Pyramid`, should be imported from the
-:mod:`pyramid.response` module. This import location contains subclasses and
-replacements that mirror those in the original ``webob.exc``.
+:mod:`pyramid.httpexceptions` module. This import location contains
+subclasses and replacements that mirror those in the original ``webob.exc``.
-Each class is named ``pyramid.response.HTTP*``, where ``*`` is the reason for
-the error. For instance, :class:`pyramid.response.HTTPNotFound`. It
-subclasses :class:`pyramid.Response`, so you can manipulate the instances in
-the same way. A typical example is:
+Each class is named ``pyramid.httpexceptions.HTTP*``, where ``*`` is the
+reason for the error. For instance,
+:class:`pyramid.httpexceptions.HTTPNotFound` subclasses
+:class:`pyramid.Response`, so you can manipulate the instances in the same
+way. A typical example is:
.. ignore-next-block
.. code-block:: python
:linenos:
- from pyramid.response import HTTPNotFound
- from pyramid.response import HTTPMovedPermanently
+ from pyramid.httpexceptions import HTTPNotFound
+ from pyramid.httpexceptions import HTTPMovedPermanently
response = HTTPNotFound('There is no such resource')
# or:
@@ -385,7 +386,7 @@ More Details
++++++++++++
More details about the response object API are available in the
-:mod:`pyramid.response` documentation. More details about exception responses
-are in the :mod:`pyramid.response` API documentation. The `WebOb
-documentation <http://pythonpaste.org/webob>`_ is also useful.
+:mod:`pyramid.response` documentation. More details about exception
+responses are in the :mod:`pyramid.httpexceptions` API documentation. The
+`WebOb documentation <http://pythonpaste.org/webob>`_ is also useful.