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.2.tar.gz (306.7 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.2-py3-none-any.whl (295.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_tagulous-2.2.2.tar.gz
  • Upload date:
  • Size: 306.7 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.2.tar.gz
Algorithm Hash digest
SHA256 64c876d0a63e868d5d15df517f0873d7355c09318b0f91babeba1afd9215c875
MD5 d3c9906331caa642206a2cd93fb19bd4
BLAKE2b-256 d433db1a5de32a51f6b753b8a6419e17f333a3341c63b4411451f1c8141c3cb1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: django_tagulous-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 295.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53bae606b425991228a3b7b41f416e52ad472afd2b43c074c9f26450fb81fd35
MD5 cf368739e54b1f63e84b99c2963e0fac
BLAKE2b-256 e0eff7b27c790099fe6da752484cb4889ba95406cd5de56c35f8f61c4609869c

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

1 file

0.14.1

1 file

0.14.0

1 file

0.13.2

1 file

0.13.1

1 file

0.13.0

1 file

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page