django-taggit

Simple tagging for django

  • 所有者: jazzband/django-taggit
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

主要指标

概览
名称与所有者jazzband/django-taggit
主编程语言Python
编程语言Python (语言数: 4)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2009-12-08 23:40:49
推送于2025-06-23 17:22:14
最后一次提交2024-11-05 12:55:28
发布数65
最新版本名称6.1.0 (发布于 )
第一版名称0.2.0 (发布于 )
用户参与
星数3.4k
关注者数63
派生数624
提交数1.2k
已启用问题?
问题数446
打开的问题数95
拉请求数344
打开的拉请求数5
关闭的拉请求数136
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?