Permalink
Please sign in to comment.
Browse files
- Added the ``pyramid.renderers.null_renderer`` object as an API. The…
… null renderer is an object that can be used in advanced integration cases as input to the view configuration ``renderer=`` argument. When the null renderer is used as a view renderer argument, Pyramid avoids converting the view callable result into a Response object. This is useful if you want to reuse the view configuration and lookup machinery outside the context of its use by the Pyramid router. This feature was added for consumption by the ``pyramid_rpc`` package, which uses view configuration and lookup outside the context of a router in exactly this way. ``pyramid_rpc`` has been broken under 1.1 since 1.1b1; adding it allows us to make it work again.
- Loading branch information...
Showing
with
309 additions
and 119 deletions.
- +15 −0 CHANGES.txt
- +9 −0 docs/api/renderers.rst
- +6 −7 pyramid/config.py
- +0 −1 pyramid/interfaces.py
- +19 −0 pyramid/renderers.py
- +20 −14 pyramid/tests/grokkedapp/__init__.py
- +15 −9 pyramid/tests/grokkedapp/another.py
- +2 −1 pyramid/tests/grokkedapp/pod/notinit.py
- +2 −1 pyramid/tests/grokkedapp/subpackage/__init__.py
- +2 −1 pyramid/tests/grokkedapp/subpackage/notinit.py
- +2 −1 pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py
- +184 −84 pyramid/tests/test_config.py
- +33 −0 pyramid/tests/test_renderers.py
15
CHANGES.txt
@@ -1,5 +1,6 @@ | ||
from pyramid.view import view_config | ||
+from pyramid.renderers import null_renderer | ||
-@view_config(name='pod_notinit') | ||
+@view_config(name='pod_notinit', renderer=null_renderer) | ||
def subpackage_notinit(context, request): | ||
return 'pod_notinit' |
@@ -1,5 +1,6 @@ | ||
from pyramid.view import view_config | ||
+from pyramid.renderers import null_renderer | ||
-@view_config(name='subpackage_init') | ||
+@view_config(name='subpackage_init', renderer=null_renderer) | ||
def subpackage_init(context, request): | ||
return 'subpackage_init' |
@@ -1,5 +1,6 @@ | ||
from pyramid.view import view_config | ||
+from pyramid.renderers import null_renderer | ||
-@view_config(name='subpackage_notinit') | ||
+@view_config(name='subpackage_notinit', renderer=null_renderer) | ||
def subpackage_notinit(context, request): | ||
return 'subpackage_notinit' |
@@ -1,5 +1,6 @@ | ||
from pyramid.view import view_config | ||
+from pyramid.renderers import null_renderer | ||
-@view_config(name='subsubpackage_init') | ||
+@view_config(name='subsubpackage_init', renderer=null_renderer) | ||
def subpackage_init(context, request): | ||
return 'subsubpackage_init' |

Oops, something went wrong.
0 comments on commit
aa2fe1b