[Django]-Django-taggit adding new tags to an object?

4👍

django-taggit does exactly what you want, but in your case sampletag != Sample_tag, so another Tag instance is created.

>>> i.tags.all()
[]
>>> i.tags.add("test")
>>> i.tags.all()
[<Tag: test>]
>>> i.tags.add("test")
>>> i.tags.all()
[<Tag: test>]
>>> 

Leave a comment