From ddd9ee16fa0c7cc19fd472fd7c1f6d28693a89be Mon Sep 17 00:00:00 2001 From: leandrafinger Date: Sat, 18 May 2013 13:34:29 +0200 Subject: Add missing imports to the examples in the 'First Steps' --- docs/intro/tutorial03.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/intro/tutorial03.txt') diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt index 86cc5f97e6..0bbfcdd02f 100644 --- a/docs/intro/tutorial03.txt +++ b/docs/intro/tutorial03.txt @@ -393,6 +393,9 @@ Now, let's tackle the poll detail view -- the page that displays the question for a given poll. Here's the view:: from django.http import Http404 + from django.shortcuts import render + + from polls.models import Poll # ... def detail(request, poll_id): try: @@ -420,6 +423,8 @@ and raise :exc:`~django.http.Http404` if the object doesn't exist. Django provides a shortcut. Here's the ``detail()`` view, rewritten:: from django.shortcuts import render, get_object_or_404 + + from polls.models import Poll # ... def detail(request, poll_id): poll = get_object_or_404(Poll, pk=poll_id) -- cgit v1.3