Skip to main content
https://badge.fury.io/py/django-taggit-labels.svg https://travis-ci.org/bennylope/django-taggit-labels.svg?branch=master

Label widget(s) for django-taggit.

Now instead of this:

https://raw.githubusercontent.com/bennylope/django-taggit-labels/master/docs/taggit-text.png

You can use this:

https://raw.githubusercontent.com/bennylope/django-taggit-labels/master/docs/taggit-labels.png

Overview

This is a widget for use in the Django admin interface, and it depends on Django’s namespaced jQuery. It allows you to add and remove tags by selecting or deselecting visual labels.

The label widget does not expose the input field so that you can add new tags. The base label widget instead shows all available tags and lets you pick between them in Django’s admin interface. It presumes that you are using a managed (or ‘curated’ if you’re feeling insufferable) tag list.

Quickstart

Install django-taggit-labels:

pip install django-taggit-labels

Add taggit_labels to your project:

INSTALLED_APPS = (
    'taggit',
    'taggit_labels',
)

Use the label widget:

from taggit.forms import TagField
from taggit_labels.widgets import LabelWidget

class ContentForm(forms.ModelForm):
    tags = TagField(required=False, widget=LabelWidget)

Just use this form class for your ModelAdmin class now:

class ContentAdmin(admin.ModelAdmin):
    form = ContentAdminForm

You can use the widget with your own tag model, too:

from taggit.forms import TagField
from taggit_labels.widgets import LabelWidget

class ContentForm(forms.Form):
    tags = TagField(required=False, widget=LabelWidget(model=MyTag))

The tag model from taggit will be presumed if you do not specify a tag model.

History

0.7.0 (2020-03-20)

  • Updated Django compat and bug fixes

0.6.0 (2018-10-29)

  • Django 2, 2.1 compatibility

0.5.1 (2017-07-23)

  • Fixes CSS class rendering

0.5.0 (2017-02-01)

  • Improved label styling

  • Javascript updates for usage outside the admin

0.4.1 (2016-01-13)

  • Adds fix for widget overloading

0.4.0 (2016-01-13)

  • Django 1.9 compatability

0.3.1 (2015-08-06)

  • Django 1.7+ compatability bug fix

0.3.0 (2015-05-20)

  • Better Unicode handling

0.2.0 (2015-03-31)

  • Adds support for multiple tag fields (thanks to Lee Solway)

0.1.6 (2014-08-04)

  • Updates styling of tag labels for line breaking and hover state

0.1.5 (2014-06-20)

  • Fixes rendering for submitted, invalid forms

0.1.4 (2014-06-09)

  • Adds cursor styling for labels

0.1.3 (2014-06-08)

  • Adds style update missed in last release

0.1.2 (2014-06-08)

  • Breaks up some widget functionality, adds minor tests

0.1.1 (2014-06-07)

  • Fixes a bug in custom model initialization

0.1.0 (2014-06-07)

  • First release on PyPI.

Release files for django-taggit-labels 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-taggit-labels 0.7.0
File Size Uploaded
django-taggit-labels-0.7.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-taggit-labels 0.7.0
File Interpreter ABI Platform
django_taggit_labels-0.7.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 15.5 kB

Release files / django-taggit-labels-0.7.0.tar.gz

Download URL django-taggit-labels-0.7.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
130f2e7769aecee1310039675a360cd1a4eb93232db720876cb86d4a8b782347
BLAKE2b-256 checksum
How to use checksums
4d1d14c8cb3e822b4fb44551e2697e57a85436b1cf47a889c9051d2b592c4b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / django_taggit_labels-0.7.0-py2.py3-none-any.whl

Download URL django_taggit_labels-0.7.0-py2.py3-none-any.whl
Size 7.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
45fcbd9c52e2d1a2fa7b0704ef93bb361c7aa6b58a473b3b1d18bb83a3041802
BLAKE2b-256 checksum
How to use checksums
fc363abc9bbd497a6ef69cbe8001afdd4ac2c62bd96e6164490cb9da7e16c412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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