Created
December 1, 2012 19:54
-
-
Save johngag/4184550 to your computer and use it in GitHub Desktop.
Django - Access ManyToMany objects in view Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for post in latest_blog_posts %} | |
<div class="row"> | |
<div> | |
<h2 class="post-title"><a href="/blog/post/{{ post.id }}/">{{ post.title }}</a></h2> | |
<h5 class="post-date">{{ post.pub_date }} - {% for cat in post.category.all %}{{ cat.name }}{% if not forloop.last %},{% endif %}{% endfor %}</h5> | |
<p class="lead">{% autoescape off %}{{ post.content|safe }}{% endautoescape %}</p> | |
</div> | |
</div> | |
<hr> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment