Skip to main content

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

Project description

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.4.5 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

django-taggit-0.18.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

django_taggit-0.18.0-py2.py3-none-any.whl (39.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-taggit-0.18.0.tar.gz.

File metadata

File hashes

Hashes for django-taggit-0.18.0.tar.gz
Algorithm Hash digest
SHA256 7010a1f7597d954aaf8b8174563f2e3455520db949d9c5d360dd9e4f906dd32a
MD5 93c2cef739334a4ae47414926b0d0965
BLAKE2b-256 bab070438aa424735535ee93f039c8c6f4daf2164d8b9b90255244c577c935e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_taggit-0.18.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4ddd61928a4fc6ba7ccb1145d8d3a6d5c2829de8d8738eea49924ade8969f0ce
MD5 5dd795b1910cbea6f56f0578a28e9bd4
BLAKE2b-256 860a9509a6a997b504d414a043cf994b16a09dc15683ffb54486669888c02cae

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