Skip to main content

django-taggit is a reusable Django application for simple tagging.

Project description

https://travis-ci.org/alex/django-taggit.svg?branch=master https://codecov.io/gh/alex/django-taggit/coverage.svg?branch=master

django-taggit a simpler approach to tagging with Django. Add "taggit" to your INSTALLED_APPS then just add a TaggableManager to your model and go:

from django.db import models

from taggit.managers import TaggableManager

class Food(models.Model):
    # ... fields here

    tags = TaggableManager()

Then you can use the API like so:

>>> apple = Food.objects.create(name="apple")
>>> apple.tags.add("red", "green", "delicious")
>>> apple.tags.all()
[<Tag: red>, <Tag: green>, <Tag: delicious>]
>>> apple.tags.remove("green")
>>> apple.tags.all()
[<Tag: red>, <Tag: delicious>]
>>> Food.objects.filter(tags__name__in=["red"])
[<Food: apple>, <Food: cherry>]

Tags will show up for you automatically in forms and the admin.

django-taggit requires Django 1.7 or greater.

For more info check out the documentation. And for questions about usage or development you can contact the mailinglist.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

django_taggit-0.21.4-py2.py3-none-any.whl (45.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-taggit-0.21.4.macosx-10.12-x86_64.tar.gz.

File metadata

File hashes

Hashes for django-taggit-0.21.4.macosx-10.12-x86_64.tar.gz
Algorithm Hash digest
SHA256 6710e26661f70416b4065b1186be6b9bb265f57e26e024763b2537e0d001c71b
MD5 c56a47e243a65520d4aca393b2f67e4d
BLAKE2b-256 4c548f353db88aa6485c5b20b9dbe389596a5d25bc4edf8e5f139470c64b59bb

See more details on using hashes here.

File details

Details for the file django_taggit-0.21.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_taggit-0.21.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58e4c6f92bcaa344c26e20f671a0e7ebeb1958cfeb6c8ae83fe3c2e96c7981b4
MD5 a53dc43c715782c7272c7dfc2e54eb2e
BLAKE2b-256 cbab394eb360ecb2bf33cc4fab7449ce0922471aa4e5cd4c3aa5ba7ff2e6da93

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page