django-taggit

Simple tagging for django

  • Owner: jazzband/django-taggit
  • Platform:
  • License:: BSD 3-Clause "New" or "Revised" License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

django-taggit

.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband

.. image:: https://travis-ci.org/jazzband/django-taggit.svg?branch=master
:target: https://travis-ci.org/jazzband/django-taggit

.. image:: https://codecov.io/gh/jazzband/django-taggit/coverage.svg?branch=master
:target: https://codecov.io/gh/jazzband/django-taggit?branch=master

This is a Jazzband <https://jazzband.co>_ project. By contributing you agree
to abide by the Contributor Code of Conduct <https://jazzband.co/about/conduct>_ and follow the guidelines <https://jazzband.co/about/guidelines>_.

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:

.. code:: python

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:

.. code:: pycon

>>> 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.11 or greater.

For more info check out the documentation <https://django-taggit.readthedocs.io/>. And for questions about usage or
development you can contact the mailinglist <https://groups.google.com/group/django-taggit>
.

Main metrics

Overview
Name With Ownerjazzband/django-taggit
Primary LanguagePython
Program languagePython (Language Count: 4)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2009-12-08 23:40:49
Pushed At2025-06-23 17:22:14
Last Commit At2024-11-05 12:55:28
Release Count65
Last Release Name6.1.0 (Posted on )
First Release Name0.2.0 (Posted on )
用户参与
Stargazers Count3.4k
Watchers Count63
Fork Count624
Commits Count1.2k
Has Issues Enabled
Issues Count445
Issue Open Count94
Pull Requests Count344
Pull Requests Open Count5
Pull Requests Close Count136
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private