comparison polls/views.py @ 1091:f7554fb88727

Update polls app to V3 design.
author Brian Neal <bgneal@gmail.com>
date Wed, 11 May 2016 21:49:14 -0500
parents 71685387dd11
children
comparison
equal deleted inserted replaced
1090:71685387dd11 1091:f7554fb88727
59 poll.total_votes_ += choice.votes 59 poll.total_votes_ += choice.votes
60 60
61 return render(request, 'polls/index.html', { 61 return render(request, 'polls/index.html', {
62 'current_polls': current_polls, 62 'current_polls': current_polls,
63 'old_polls': old_polls, 63 'old_polls': old_polls,
64 'V3_DESIGN': True,
64 }) 65 })
65 66
66 ####################################################################### 67 #######################################################################
67 68
68 def poll_detail(request, poll_id): 69 def poll_detail(request, poll_id):
75 return render(request, 'polls/poll_detail.html', { 76 return render(request, 'polls/poll_detail.html', {
76 'poll': poll, 77 'poll': poll,
77 'total_votes': total_votes, 78 'total_votes': total_votes,
78 'choices': choices, 79 'choices': choices,
79 'user_choice': get_user_choice(request.user, poll), 80 'user_choice': get_user_choice(request.user, poll),
81 'V3_DESIGN': True,
80 }) 82 })
81 83
82 ####################################################################### 84 #######################################################################
83 85
84 @login_required 86 @login_required
104 106
105 return render(request, 'polls/poll_vote.html', { 107 return render(request, 'polls/poll_vote.html', {
106 'poll': poll, 108 'poll': poll,
107 'vote_form': vote_form, 109 'vote_form': vote_form,
108 'user_choice': user_choice, 110 'user_choice': user_choice,
111 'V3_DESIGN': True,
109 }) 112 })
110 113
111 ####################################################################### 114 #######################################################################
112 115
113 @require_POST 116 @require_POST