Ticket #1464: tutorial04.diff
File tutorial04.diff, 579 bytes (added by , 19 years ago) |
---|
-
tutorial04.txt
55 55 def vote(request, poll_id): 56 56 p = get_object_or_404(Poll, pk=poll_id) 57 57 try: 58 selected_choice = p.choice_set. filter(pk=request.POST['choice'])58 selected_choice = p.choice_set.get(pk=request.POST['choice']) 59 59 except (KeyError, Choice.DoesNotExist): 60 60 # Redisplay the poll voting form. 61 61 return render_to_response('polls/detail', {