django: finish tutorial #3

This commit is contained in:
2018-05-06 20:21:35 -07:00
parent d930315fb3
commit 25bfca067c
4 changed files with 39 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
<h1>{{ question.question_text }}</h1>
<ul>
{% for choice in question.choice_set.all %}
<li>{{ choice.choice_text }}</li>
{% endfor %}
</ul>

View File

@@ -0,0 +1,9 @@
{% if latest_questions %}
<ul>
{% for question in latest_questions %}
<li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No polls are available.</p>
{% endif %}