diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-04-14 02:49:19 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-04-14 02:49:19 +0000 |
| commit | ff1213e8f2aed987108ba57aed517c033491b1aa (patch) | |
| tree | f531544c3373ae7d5b51746987cb373326277a9c /docs/zcml | |
| parent | 2b6bc8adfa294f7133680f64df411251afb67dfc (diff) | |
| download | pyramid-ff1213e8f2aed987108ba57aed517c033491b1aa.tar.gz pyramid-ff1213e8f2aed987108ba57aed517c033491b1aa.tar.bz2 pyramid-ff1213e8f2aed987108ba57aed517c033491b1aa.zip | |
Add "exception views" work contributed primarily by Andrey Popp by merging the "phash" branch.
Diffstat (limited to 'docs/zcml')
| -rw-r--r-- | docs/zcml/forbidden.rst | 16 | ||||
| -rw-r--r-- | docs/zcml/notfound.rst | 16 |
2 files changed, 28 insertions, 4 deletions
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 ~~~~~~~~ |
