Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################### VIEW ##############################################
- def vote_stats_view(request):
- obj = Choice.objects.all()
- context = {
- 'object': obj
- }
- return render(request, "polls/vote_stats.html", context)
- ################################### HTML ##############################################
- {% load static %}
- <link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}">
- <body>
- <table summary="Tabela testowa 2" id="tabela">
- <tr>
- <td>
- <table summary="Tabela testowa" id="tabela">
- <tr>
- <th scope="col">Question</th>
- <th scope="col">Choice</th>
- <th scope="col">Votes</th>
- </tr>
- {% for item in object %}
- <tr>
- <td>{{item.question.question_text}}</td>
- <td>{{item.choice_text}}</td>
- <td>{{item.votes}}</td>
- </tr>
- {%endfor%}
- </table>
- </td>
- </tr>
- </table>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment