Recent polls
{% for question in rt.models.polls.Question.objects.filter(hidden=False).order_by('pub_date') %}
-
{{question.question_text}}
{% set sep = joiner(" / ") %}
{% for choice in question.choice_set.all() %}
{{ sep() }}
{{ choice.vote.as_button(ar, str(choice))}}
{% endfor %}
Published {{fdl(question.pub_date)}}
Results:
{% set sep = joiner(", ") %}
{% for choice in question.choice_set.all() %}
{{ sep() }}{{choice.votes}}x {{str(choice)}}
({{100.0 * choice.votes / (question.choice_set.aggregate(Sum('votes'))['votes__sum'] or 1)}} %)
{% endfor %}
{% endfor %}