summaryrefslogtreecommitdiff
path: root/docs/intro/tutorial04.txt
diff options
context:
space:
mode:
authorleandrafinger <leandra.finger@gmail.com>2013-05-18 13:34:29 +0200
committerMarc Egli <frog32@me.com>2013-05-18 18:39:21 +0200
commitddd9ee16fa0c7cc19fd472fd7c1f6d28693a89be (patch)
treee02522750044d0bb2ec6b8c983b9e5a99c105e53 /docs/intro/tutorial04.txt
parentcd72c55d8603751af40a55d2d18f264827fa0744 (diff)
Add missing imports to the examples in the 'First Steps'
Diffstat (limited to 'docs/intro/tutorial04.txt')
-rw-r--r--docs/intro/tutorial04.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/intro/tutorial04.txt b/docs/intro/tutorial04.txt
index 9f54243a3e..f81a7d6758 100644
--- a/docs/intro/tutorial04.txt
+++ b/docs/intro/tutorial04.txt
@@ -136,6 +136,8 @@ object. For more on :class:`~django.http.HttpRequest` objects, see the
After somebody votes in a poll, the ``vote()`` view redirects to the results
page for the poll. Let's write that view::
+ from django.shortcuts import get_object_or_404, render
+
def results(request, poll_id):
poll = get_object_or_404(Poll, pk=poll_id)
return render(request, 'polls/results.html', {'poll': poll})