Django-taggit - how do I diplay the tags related to each record?

Models. Py from django. Db import models from taggit.

Managers import TaggableManager class MyObject(models. Model): title = models. CharField(max_length=100) content = models.TextField() tags = TaggableManager() views.Py from django.views.

Generic import simple def show_object(request): """ View all objects """ return simple. Direct_to_template(request, template="folder/template. Html", extra_context={ 'objects':MyObject.objects.all(), }) template.

Py {% for object in objects %} {{ object. Title }} {{ object. Content }} {% for tag in object.tags.

All %} {{ tag. Name }} {% endfor %} {% endfor %}.

Thank you! Great example! – avatar Jun 7 at 14:21.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions