diff options
| author | Steve Piercy <web@stevepiercy.com> | 2016-09-29 00:25:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-29 00:25:41 -0700 |
| commit | 2058b2e25cf261505efeb75db6ca49bc2749d3cf (patch) | |
| tree | 4be43c097dfd2fa08f036e524b04863bee197741 /docs | |
| parent | 9060dffe29e60e7528aab8d6d2006eee3cd72522 (diff) | |
| parent | 0fdafb4336b83f567861260ee1b1cac51a23bb1f (diff) | |
| download | pyramid-2058b2e25cf261505efeb75db6ca49bc2749d3cf.tar.gz pyramid-2058b2e25cf261505efeb75db6ca49bc2749d3cf.tar.bz2 pyramid-2058b2e25cf261505efeb75db6ca49bc2749d3cf.zip | |
Merge pull request #2776 from stevepiercy/master
Clean up docstrings/narr docs from PR #2660
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/viewconfig.rst | 10 | ||||
| -rw-r--r-- | docs/narr/views.rst | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index 76eaf3cc5..7cb8e0306 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -307,8 +307,8 @@ configured view. interface; it is otherwise false. It is possible to pass an exception class as the context if your context may - subclass an exception. In this case **two** views will be registered. One - will match normal incoming requests and the other will match as an + subclass an exception. In this case *two* views will be registered. One + will match normal incoming requests, and the other will match as an :term:`exception view` which only occurs when an exception is raised during the normal request processing pipeline. @@ -317,11 +317,11 @@ configured view. ``exception_only`` - When this value is ``True`` the ``context`` argument must be a subclass of + When this value is ``True``, the ``context`` argument must be a subclass of ``Exception``. This flag indicates that only an :term:`exception view` should - be created and that this view should not match if the traversal + be created, and that this view should not match if the traversal :term:`context` matches the ``context`` argument. If the ``context`` is a - subclass of ``Exception`` and this value is ``False`` (the default) then a + subclass of ``Exception`` and this value is ``False`` (the default), then a view will be registered to match the traversal :term:`context` as well. .. versionadded:: 1.8 diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 465062651..ab139ea19 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -262,13 +262,13 @@ specialized views as described in :ref:`special_exceptions_in_callables` can also be used by application developers to convert arbitrary exceptions to responses. -To register a :term:`exception view` that should be called whenever a +To register an :term:`exception view` that should be called whenever a particular exception is raised from within :app:`Pyramid` view code, use :meth:`pyramid.config.Configurator.add_exception_view` to register a view configuration which matches the exception (or a subclass of the exception) and points at a view callable for which you'd like to generate a response. The exception will be passed as the ``context`` argument to any -:term:`view predicate` registered with the view as well as to the view itself. +:term:`view predicate` registered with the view, as well as to the view itself. For convenience a new decorator exists, :class:`pyramid.views.exception_view_config`, which may be used to easily register exception views. @@ -334,7 +334,7 @@ which have a name will be ignored. In most cases, you should register an :term:`exception view` by using :meth:`pyramid.config.Configurator.add_exception_view`. However, it is - possible to register 'normal' (i.e., non-exception) views against a context + possible to register "normal" (i.e., non-exception) views against a context resource type which inherits from :exc:`Exception` (i.e., ``config.add_view(context=Exception)``). When the view configuration is processed, *two* views are registered. One as a "normal" view, the other |
