Skip to main content

Alternate labels for django-taggit

Project description

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_labels.widgets import LabelWidget

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

Just use this form class for your ModelAdmin class now.

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

from taggit_labels.widgets import LabelWidget

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

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

History

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.

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-taggit-labels-0.6.0.tar.gz (8.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_taggit_labels-0.6.0-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-taggit-labels-0.6.0.tar.gz.

File metadata

  • Download URL: django-taggit-labels-0.6.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.2

File hashes

Hashes for django-taggit-labels-0.6.0.tar.gz
Algorithm Hash digest
SHA256 a2845d3797eea728db436934c704245ff32b3d358c11e73826f26146b5c0d478
MD5 b6846a250fffbeb410089a85abdf27b2
BLAKE2b-256 2f7eac3f0ca7e5d58b13dcff6c3f68c5a0cdfb59f52c9bc89e94f06c56fcd4d5

See more details on using hashes here.

File details

Details for the file django_taggit_labels-0.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_taggit_labels-0.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.2

File hashes

Hashes for django_taggit_labels-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1f5593f63a30b9bee72731feae021e43bee880fe96284fbabfb741daf72290ce
MD5 49d39e18355e4fede3c96120f530c433
BLAKE2b-256 e4bc5dce2ebd98d7a1228ed33d14c2cbd787d23a44616f0f81de2e105ff425e2

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