Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def submit_handler(request):
- if request.POST:
- voting_on = request.POST.get('voting_on').split(',')
- for vote_key in voting_on:
- vote = Vote.objects.get(pk=vote_key)
- vote_value = request.POST.get('vote_%s' % vote_key)
- vote.set_vote_value(vote_value)
- vote.save()
- return HttpResponse("THANKS VOR YOUR VOTES")
- else:
- votes_to_vote_on = Vote.get_votes_for_user(request.user)
- return render_to_response('form.html', RequestContext({'votes': votes_to_vote_on}))
Add Comment
Please, Sign In to add comment