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.

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.0.tar.gz (305.8 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.0-py3-none-any.whl (294.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_tagulous-2.2.0.tar.gz
  • Upload date:
  • Size: 305.8 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.0.tar.gz
Algorithm Hash digest
SHA256 41719f16976f505f578a590c4c53bdc956e53b22e5350ac64fb68a015bcd9a65
MD5 69f5436525b57b2b000937124689006d
BLAKE2b-256 9e6da13cc280816149664d7a5ad9655288210c8627387ab106c31a60e36d2e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tagulous-2.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: django_tagulous-2.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f26f9eb98e7a6aafcac405c0a1905149276af87006efb63f9a28918497ca89d
MD5 40116f9be288db89614dbae1f92db072
BLAKE2b-256 15c90216e5e1ce2a43e4de37c100667a0e67192697f1921ccc95b5d30a21b66d

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tagulous-2.2.0-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