Everything that TonyF said, but also - your choice.votes|pluralize tag will 
not work - tags need to be all on online from open to closing braces

On Wednesday, June 6, 2018 at 1:01:05 PM UTC-4, Avitab Ayan Sarmah wrote:
>
> results.html:
>
> <h1>{{ question.question_text }}</h1>
>
> <ul>
> {% for choice in question.choice_set.all %}
>   <li>{{ choice.choice_text }} -- {{ choice.votes }} vote{{
> choice.votes|pluralize }}</li>
> {% endfor %}
> </ul>
>
> <a href="{% url 'polls:detail' question.id %}">vote again?</a>
>
>
> detail.html:
>
> <h1>{{ question.question_text }}</h1>
>
> {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif 
> %}
>
> <form action="{% url 'polls:vote' question.id %}" method="post">
> {% csrf_token %}
> {% for choice in question.choice_set.all %}
>   <input type="radio" name="choice" id="choice{{ forloop.counter }}"
> value="{{ choice.id }}" />
>   <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}
> </label><br />
> {% endfor %}
> <input type="submit" value="vote" />
> </form>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/485ea3c6-f60f-419a-b9f7-cbef3682fcd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to