diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-10-08 03:00:55 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-10-08 03:00:55 +0000 |
| commit | 3e338a3835a1d37d328f19c8add42af0afd9533c (patch) | |
| tree | 544bc2b4f738af204a8be8006398cafb27d01ed2 /docs | |
| parent | 4e6699332b870f7d9f44fbcfea8f28aa4740d598 (diff) | |
| download | pyramid-3e338a3835a1d37d328f19c8add42af0afd9533c.tar.gz pyramid-3e338a3835a1d37d328f19c8add42af0afd9533c.tar.bz2 pyramid-3e338a3835a1d37d328f19c8add42af0afd9533c.zip | |
tweak
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/views.rst | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/docs/narr/views.rst b/docs/narr/views.rst index dd247333b..ac726abcc 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -265,17 +265,21 @@ Response interface, :mod:`repoze.bfg` will attempt to use a The above example returns a *dictionary* from the view callable. A dictionary does not implement the :term:`WebOb` response interface, so -without special configuration, this example would fail. However, -since a ``renderer`` is associated with the view callable through its -view configuration (in this case, using a ``renderer`` argument passed -to :func:`repoze.bfg.bfg_view`), if the view does *not* return a -Response object, the renderer will attempt to convert the result of -the view to a response on the developer's behalf. Of course, if no -renderer is associated with a view's configuration, returning anything -except an object which implements the WebOb Response interface will -result in an error. And, if a renderer *is* used, whatever is -returned by the view must be compatible with the particular kind of -renderer used, or an error may occur during view invocation. +you might believe that this example would fail. However, since a +``renderer`` is associated with the view callable through its +:term:`view configuration` (in this case, using a ``renderer`` +argument passed to :func:`repoze.bfg.view.bfg_view`), if the view does +*not* return a Response object, the renderer will attempt to convert +the result of the view to a response on the developer's behalf. Of +course, if no renderer is associated with a view's configuration, +returning anything except an object which implements the WebOb +Response interface will result in an error. And, if a renderer *is* +used, whatever is returned by the view must be compatible with the +particular kind of renderer used, or an error may occur during view +invocation. One exception exists: it is *always* OK to return a WebOb +Response object, even when a ``renderer`` is configured. If a view +callable returns a response object from a view that is configured with +a renderer, the renderer is bypassed entirely. Various types of renderers exist, including serialization renderers and renderers which use templating systems. See also |
