diff options
| author | Chris McDonough <chrism@plope.com> | 2012-09-16 03:27:00 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-09-16 03:27:00 -0400 |
| commit | 3f3917f9c70ddc83263e440a8bc781bacb33bb6e (patch) | |
| tree | cb513aa71c26efd12c4ebc7e37836d5b5b7f6615 /docs | |
| parent | 37d2c224b804dfebe9ee217c7a536364eacdee15 (diff) | |
| download | pyramid-3f3917f9c70ddc83263e440a8bc781bacb33bb6e.tar.gz pyramid-3f3917f9c70ddc83263e440a8bc781bacb33bb6e.tar.bz2 pyramid-3f3917f9c70ddc83263e440a8bc781bacb33bb6e.zip | |
moar
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/subrequest.rst | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/narr/subrequest.rst b/docs/narr/subrequest.rst index 6ed679579..5067fa890 100644 --- a/docs/narr/subrequest.rst +++ b/docs/narr/subrequest.rst @@ -84,10 +84,10 @@ adapter will work too: Being able to unconditionally obtain a response object by invoking a view callable indirectly is the main advantage to using -:meth:`pyramid.request.Request.subrequest` instead of simply importing it and -executing it directly. Note that there's not much advantage to invoking a -view using a subrequest if you *can* invoke a view callable directly. It's -much slower to use a subrequest. +:meth:`pyramid.request.Request.subrequest` instead of simply importing the +view callable and executing it directly. Note that there's not much +advantage to invoking a view using a subrequest if you *can* invoke a view +callable directly. It's much slower to use a subrequest. The :meth:`pyramid.request.Request.subrequest` API accepts two arguments: a positional argument ``request`` that must be provided, and and ``use_tweens`` @@ -141,3 +141,7 @@ subrequest's URL, its headers, its request method, and other attributes. See the documentation for :class:`pyramid.request.Request` to understand how to massage your new request object into something that will match the view you'd like to call via a subrequest. + +We've demonstrated use of a subrequest from within a view callable, but you +can use the :meth:`~pyramid.request.Request.subrequest` API from within a +tween or an event handler as well. |
