GithubHelp home page GithubHelp logo

apsl / django-taggit-labels Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bennylope/django-taggit-labels

0.0 7.0 0.0 117 KB

Clickable label widget for django-taggit

License: BSD 3-Clause "New" or "Revised" License

Makefile 16.85% Python 69.13% CSS 2.48% JavaScript 11.54%

django-taggit-labels's Introduction

django-taggit-labels

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.

django-taggit-labels's People

Contributors

bennylope avatar fdemmer avatar leejp74 avatar svleeuwen avatar zeograd avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.