1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

magic-removal: Fixed #1464 -- Fixed error in docs/tutorial04.txt. Thanks, ubernostrum

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-04-23 21:49:07 +00:00
parent 121c9c9692
commit 8b37669742

View File

@ -53,7 +53,7 @@ So let's create a ``vote()`` function in ``mysite/polls/views.py``::
def vote(request, poll_id): def vote(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id) p = get_object_or_404(Poll, pk=poll_id)
try: try:
selected_choice = p.choice_set.filter(pk=request.POST['choice']) selected_choice = p.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist): except (KeyError, Choice.DoesNotExist):
# Redisplay the poll voting form. # Redisplay the poll voting form.
return render_to_response('polls/detail.html', { return render_to_response('polls/detail.html', {