summaryrefslogtreecommitdiff
path: root/docs/narr
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-11 01:17:51 -0500
committerChris McDonough <chrism@plope.com>2010-11-11 01:17:51 -0500
commit2a2d5024caaa62bee540e32a8f63aa0998f1b9cd (patch)
tree30de4e6b042782ed8a67f470e42c245b1c77588e /docs/narr
parenta95c2a8ee5c1fa990042c9c41e69179083a02301 (diff)
downloadpyramid-2a2d5024caaa62bee540e32a8f63aa0998f1b9cd.tar.gz
pyramid-2a2d5024caaa62bee540e32a8f63aa0998f1b9cd.tar.bz2
pyramid-2a2d5024caaa62bee540e32a8f63aa0998f1b9cd.zip
fix issue 32: use renderer rather than zpt render_template_to_response
Diffstat (limited to 'docs/narr')
-rw-r--r--docs/narr/hooks.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index b2d30cae4..2bb66e559 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -159,10 +159,11 @@ Here's some sample code that implements a minimal forbidden view:
.. code-block:: python
:linenos:
- from pyramid.chameleon_zpt import render_template_to_response
+ from pyramid.views import view_config
+ @view_config(renderer='templates/login_form.pt')
def forbidden_view(request):
- return render_template_to_response('templates/login_form.pt')
+ return {}
.. note:: When a forbidden view callable is invoked, it is passed a
:term:`request`. The ``exception`` attribute of the request will