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.10.0; supports Django 1.4 to 1.9a1, on Python 2.7.

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.10.0.tar.gz (213.1 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.10.0-py2-none-any.whl (120.2 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django-tagulous-0.10.0.tar.gz
Algorithm Hash digest
SHA256 0a74b134634afa0cd9bf6e4400b9cf52c97b958773b8e2650e7543f237ba2565
MD5 1ae616d743637835231dfb169a933bee
BLAKE2b-256 e7321d786e1214632121a86dbd00b2ac2b8cdbc7b38242c00a106b6b7d47207e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_tagulous-0.10.0-py2-none-any.whl
Algorithm Hash digest
SHA256 b14029a88a16703967101f61e6c940928f46edc17e1a36b57e60e6f6bca3f51d
MD5 9a2954a9b27a5f4ea7d7ed6708e5f839
BLAKE2b-256 398657e064f170a492f2d1cfd5fe513fdc05a00ed8b3570a2c84d72d143f7ce7

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