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.5-py2.py3-none-any.whl (45.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-taggit-0.21.5.macosx-10.12-x86_64.tar.gz
Algorithm Hash digest
SHA256 076fc8fe34f83012b5daa876543aa864fd021e8411e2108d152ce8e49960f087
MD5 9ae6ab25ed29b2e47cf352241b2c6fe6
BLAKE2b-256 84f3af7e7dd9365fec3be7726cfe9447535fea4288e56cd3170634d994547106

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_taggit-0.21.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8c2ef39f0349dff2a71dd07ea267f1d26f6e0cfbc3b7df2eec5f78f07c7f8343
MD5 b1c02884e5530f86ecae40cdf3c75ce4
BLAKE2b-256 ab52c0ee071c2e10c7717a747966b4e5ff652a87f18d18cf214970853c05557a

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