django: finish tutorial #3
This commit is contained in:
6
django/mysite/polls/templates/polls/detail.html
Normal file
6
django/mysite/polls/templates/polls/detail.html
Normal 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>
|
||||
9
django/mysite/polls/templates/polls/index.html
Normal file
9
django/mysite/polls/templates/polls/index.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user