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:
parent
121c9c9692
commit
8b37669742
@ -53,7 +53,7 @@ So let's create a ``vote()`` function in ``mysite/polls/views.py``::
|
||||
def vote(request, poll_id):
|
||||
p = get_object_or_404(Poll, pk=poll_id)
|
||||
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):
|
||||
# Redisplay the poll voting form.
|
||||
return render_to_response('polls/detail.html', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user