1# models.py
2
3from django.db import models
4from taggit.managers import TaggableManager
5
6class MyObject(models.Model):
7 title = models.CharField(max_length=100)
8 content = models.TextField()
9
10 tags = TaggableManager()
11
12#template.html
13
14{% for object in objects %}
15 <h2>{{ object.title }}</h2>
16 <p>{{ object.content }}</p>
17 <ul>
18 {% for tag in object.tags.all %}
19 <li> {{ tag.name }} </li>
20 {% endfor %}
21 </ul>
22{% endfor %}
23