1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Add missing imports to the examples in the 'First Steps'

This commit is contained in:
leandrafinger
2013-05-18 13:34:29 +02:00
committed by Marc Egli
parent cd72c55d86
commit ddd9ee16fa
5 changed files with 29 additions and 0 deletions

View File

@@ -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})