From ff1213e8f2aed987108ba57aed517c033491b1aa Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 14 Apr 2010 02:49:19 +0000 Subject: Add "exception views" work contributed primarily by Andrey Popp by merging the "phash" branch. --- docs/zcml/forbidden.rst | 16 ++++++++++++++-- docs/zcml/notfound.rst | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'docs/zcml') diff --git a/docs/zcml/forbidden.rst b/docs/zcml/forbidden.rst index bd2235ccf..5a52a05ab 100644 --- a/docs/zcml/forbidden.rst +++ b/docs/zcml/forbidden.rst @@ -9,6 +9,14 @@ view`. The default forbidden response has a 401 status code and is very plain, but it can be overridden as necessary using the ``forbidden`` ZCML directive. +.. warning:: + + The ``forbidden`` ZCML directive is deprecated in :mod:`repoze.bfg` + version 1.3. Instead, you should use the :ref:`view_directive` + directive with a ``context`` that names the + :exc:`repoze.bfg.exceptions.Forbidden` class. See + :ref:`changing_the_forbidden_view` form more information. + Attributes ~~~~~~~~~~ @@ -63,8 +71,12 @@ Example Alternatives ~~~~~~~~~~~~ -The :meth:`repoze.bfg.configuration.Configurator.set_forbidden_view` -method performs the same job as the ``forbidden`` ZCML directive. +Use the :ref:`view_directive` directive with a ``context`` that names +the :exc:`repoze.bfg.exceptions.Forbidden` class. + +Use the :meth:`repoze.bfg.configuration.Configurator.add_view` method, +passing it a ``context`` which is the +:exc:`repoze.bfg.exceptions.Forbidden` class. See Also ~~~~~~~~ diff --git a/docs/zcml/notfound.rst b/docs/zcml/notfound.rst index 141cac6f9..3fe9900d4 100644 --- a/docs/zcml/notfound.rst +++ b/docs/zcml/notfound.rst @@ -3,6 +3,14 @@ ``notfound`` ------------ +.. warning:: + + The ``notfound`` ZCML directive is deprecated in :mod:`repoze.bfg` + version 1.3. Instead, you should use the :ref:`view_directive` + directive with a ``context`` that names the + :exc:`repoze.bfg.exceptions.NotFound` class. See + :ref:`changing_the_notfound_view` form more information. + When :mod:`repoze.bfg` can't map a URL to view code, it invokes a :term:`not found view`. The default not found view is very plain, but the view callable used can be configured via the ``notfound`` ZCML @@ -62,8 +70,12 @@ Example Alternatives ~~~~~~~~~~~~ -The :meth:`repoze.bfg.configuration.Configurator.set_notfound_view` -method performs the same job as the ``notfound`` ZCML directive. +Use the :ref:`view_directive` directive with a ``context`` that names +the :exc:`repoze.bfg.exceptions.NotFound` class. + +Use the :meth:`repoze.bfg.configuration.Configurator.add_view` method, +passing it a ``context`` which is the +:exc:`repoze.bfg.exceptions.NotFound` class. See Also ~~~~~~~~ -- cgit v1.2.3