shows tags of each post in post_list

This commit is contained in:
Esther Kleinhenz
2018-08-18 12:10:40 +02:00
parent 1a2130bb49
commit 42d69dfe44
5 changed files with 9 additions and 5 deletions
+2
View File
@@ -17,5 +17,7 @@
{% endif %}
<h1>{{ post.title }}</h1>
<p>{{ post.text|linebreaksbr }}</p>
<p>{{ post.tag }}</p>
</div>
{% endblock %}
+5
View File
@@ -7,5 +7,10 @@
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
</h1>
<p>{{ post.text|linebreaks }}</p>
{% for tag in post.tags.all %}
<p>{{ tag.name }}</p>
{% endfor %}
</div>
{% endfor %} {% endblock %}
-2
View File
@@ -6,8 +6,6 @@
</button>
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
</form>
<div>{{Post.objects.filter(tags__name__in= ["hi"])}}
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
</table>