Skip to main content

Django Tagulous - Fabulous Tags

PyPI Documentation Tests Coverage

A tagging library for Django. Built on ForeignKey and ManyToManyField to support tag strings as well as native ORM queries.

Use a SingleTagField as a CharField with dynamic choices, or a TagField for conventional tagging or nested categorisation.

If you find this project useful, please do consider sponsoring development.

Features

  • Easy to install - simple requirements, simple syntax, lots of options
  • Based on ForeignKey and ManyToManyField, so it's easy to query
  • Autocomplete support built in, if you want it
  • Supports multiple independent fields on a single model
  • Supports trees of nested tags, for detailed categorisation
  • Admin support for managing tags and tagged models

Tested on Django 3.2 to 6.1, on Python 3.10+.

See the Documentation for details of how Tagulous works; in particular:

Quickstart

Install with pip install django-tagulous, add django_tagulous to Django's INSTALLED_APPS and define the serializers, then start adding tag fields to your model:

from django.db import models
from django_tagulous.models import SingleTagField, TagField

class Person(models.Model):
    name = models.CharField(max_length=255)
    title = SingleTagField(initial="Mr, Mrs, Miss, Ms")
    skills = TagField()

You can now set and get them using strings, lists or querysets:

myperson = Person.objects.create(name='Bob', title='Mr', skills='run, hop')
# myperson.skills == 'run, hop'
myperson.skills = ['jump', 'kung fu']
myperson.save()
# myperson.skills == 'jump, "kung fu"'
runners = Person.objects.filter(skills='run')

Behind the scenes each tag field is a ForeignKey or ManyToManyField relationship to a separate model (by default), so more complex queries are simple:

qs = MyRelatedModel.objects.filter(
    person__skills__name__in=['run', 'jump'],
)

As well as this you also get autocompletion in public and admin forms, automatic slug generation, unicode support, you can build tag clouds easily, and can nest tags for more complex categorisation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_tagulous-2.2.1.tar.gz (306.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_tagulous-2.2.1-py3-none-any.whl (294.9 kB view details)

Uploaded Python 3

File details

Details for the file django_tagulous-2.2.1.tar.gz.

File metadata

  • Download URL: django_tagulous-2.2.1.tar.gz
  • Upload date:
  • Size: 306.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_tagulous-2.2.1.tar.gz
Algorithm Hash digest
SHA256 561827e9b5a6f56c4810daf63209ad8253314fe2f1e8f396855436b94c04b20b
MD5 a316372db0b6b750d0d39da051b3d6b4
BLAKE2b-256 3c5b9a9c2c30b040d0e30155174798ef29b7df01800559febc221b244e8ee272

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tagulous-2.2.1.tar.gz:

Publisher: pypi.yml on radiac/django-tagulous

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_tagulous-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_tagulous-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 294.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_tagulous-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b722e5e2bb159bb35897ee793ba83cd8a5b0c0f5bc2b5e2a8717c28bfb8a467
MD5 38339b3412d712882be44d0ca7a75db6
BLAKE2b-256 48767cf5cadaf8646c0a4a5bf63e4908dd663f35bf423f0626369c4dd08620d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tagulous-2.2.1-py3-none-any.whl:

Publisher: pypi.yml on radiac/django-tagulous

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page