Coder Social home page Coder Social logo

django-rdf-tools / django-chosen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theatlantic/django-chosen

1.0 1.0 1.0 127 KB

django FormFields using the Chosen javascript plugin for jQuery

License: Other

JavaScript 88.60% Python 11.40%

django-chosen's Introduction

django-chosen

django-chosen is a project that makes available django FormFields that uses the Chosen javascript plugin. It was created by developers at The Atlantic.

Installation

The recommended way to install from source is with pip:

$ pip install -e git+git://github.com/theatlantic/django-chosen.git#egg=django-chosen

If the source is already checked out, use setuptools:

$ python setup.py install

Usage

django-chosen makes available the following fields and widget:

Fields:

- ``ChosenChoiceField``
- ``ChosenModelChoiceField``
- ``ChosenMultipleChoiceField``
- ``ChosenModelMultipleChoiceField``

Widgets:

- ``ChosenSelect``
- ``ChosenSelectMultiple``

The django-chosen fields can be passed an optional kwarg overlay that overrides the text which appears when no option is selected in the dropdown.

Example

from django import forms
from chosen import forms as chosenforms

class BookForm(forms.Form):
    name = forms.CharField(max_length=100)
    quality = chosenforms.ChosenChoiceField(overlay="Select book quality...",
        choices=(('New', 'new'), ('Used', 'used')))
    authors = chosenforms.ChosenModelMultipleChoiceField(queryset=Author.objects.all())

License

The django code is licensed under the Simplified BSD License and is copyright The Atlantic Media Company. View the LICENSE file under the root directory for complete license and copyright information.

The Chosen javascript library included is licensed under the MIT License. View chosen/media/js/chosen.LICENSE.md for complete license and copyright information about the Chosen javascript library.

Chosen javascript documentation

Chosen is a library for making long, unwieldy select boxes more user friendly.

  • jQuery support: 1.4+
  • Prototype support: 1.7+

For documentation, usage, and examples, see: http://harvesthq.github.com/chosen

Chosen Credits

django-chosen's People

Contributors

fdintino avatar adrienlemaire avatar h1d avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Forkers

makinacorpus

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.