November 2015
Beginner to intermediate
840 pages
26h 30m
English
Tag objectsCreate a new template at /organizer/templates/organizer/tag_list.html. In Example 4.27, as you may have guessed from the file name, we will list all of our Tag objects. In Chapter 5, we will put a list of tags to the tag_list variable.
Example 4.27: Project Code
organizer/templates/organizer/tag_list.html in b4fb40ec0c
1 <h2>Tag List</h2> 2 <ul> 3 {% for tag in tag_list %} 4 <li> 5 <a href=""> 6 {{ tag.name|title }}</a> 7 </li> 8 {% endfor %} 9 </ul>
As before, we use a for loop to iterate through the tag_list that we assume the template is provided with. This loop gives us access to a tag object, which we print ...
Read now
Unlock full access