Skip to main content

A flexible tagging application for Django

Project description

A tagging library for Django built on ForeignKey and ManyToManyField, giving you all their normal power with a sprinkling of tagging syntactic sugar.

https://travis-ci.org/radiac/django-tagulous.svg?branch=master https://coveralls.io/repos/radiac/django-tagulous/badge.svg?branch=master&service=github

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 tag fields on a single model

  • Can be used as a user-customisable CharField with choices

  • Supports trees of nested tags, for detailed categorisation

  • Admin support for managing tags and tagged models

Version 0.11.0 (2015-10-04); supports Django 1.4.2 to 1.9a1, on Python 2.7 to 3.5.

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

Quickstart

Install with pip install django-tagulous, add tagulous to Django’s INSTALLED_APPS, then start adding tag fields to your model:

from django.db import models
import tagulous

class Person(models.Model):
    name = models.CharField(max_length=255)
    title = tagulous.models.SingleTagField(initial="Mr, Mrs, Miss, Ms")
    skills = tagulous.models.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 your tags are stored in separate models (by default), so because the fields are based on ForeignKey and ManyToManyField 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.

Project details


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-0.11.0.tar.gz (214.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-0.11.0-py2-none-any.whl (121.2 kB view details)

Uploaded Python 2

File details

Details for the file django-tagulous-0.11.0.tar.gz.

File metadata

File hashes

Hashes for django-tagulous-0.11.0.tar.gz
Algorithm Hash digest
SHA256 2496048c24c21138a77c22bc67e1f805dac5f4e3d926af129c4be4f54c1f967f
MD5 0c1eaba50b91a95e8cd33e9b0e458a59
BLAKE2b-256 362ff99a42fb7c006e9590cb7fcc043b379e5d5de4152dab84222088848316ed

See more details on using hashes here.

File details

Details for the file django_tagulous-0.11.0-py2-none-any.whl.

File metadata

File hashes

Hashes for django_tagulous-0.11.0-py2-none-any.whl
Algorithm Hash digest
SHA256 1264c6487c42b15fe26ef44f3f4b2490fe0d3a4efb432e58b838cd844110cd79
MD5 7eb1c86c7d51fafe5469f963afad417d
BLAKE2b-256 57d26f2e5177f1e7c8a9d329ceb7fd4bb493db165744f82ed8dfad0661702b8b

See more details on using hashes here.

Supported by

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