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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?