def tally(request):
    if (request.method == 'POST'):
        list = request.POST
        candidates_id = list.items()
        all_candidates = Candidate.objects.all()
        for id in candidates_id:
            print(id[1])
            for candidate in all_candidates:
                print(candidate.candidate_text)
                if (candidate.candidate_text == id[1]):
                    print(((candidate.candidate_text + ' ') + id[1]))
                    candidate.votes += 1
                    candidate.save()
        return render(request, 'vote/votetotals.html')
    else:
        return render(request, 'vote/votetotals.html')
def tally(request):
    if (request.method == 'POST'):
        list = request.POST
        candidates_id = list.items()
        all_candidates = Candidate.objects.all()
        for id in candidates_id:
            print(id[1])
            for candidate in all_candidates:
                print(candidate.candidate_text)
                if (candidate.candidate_text == id[1]):
                    print(((candidate.candidate_text + ' ') + id[1]))
                    candidate.votes += 1
                    candidate.save()
        return render(request, 'vote/votetotals.html')
    else:
        return render(request, 'vote/votetotals.html')