Skip to main content

Django multiple select field

Project description

django-multiselectfield

https://badge.fury.io/py/django-multiselectfield.png https://pypip.in/d/django-multiselectfield/badge.png

A new model and form field. With this you can get a multiple select from a choices

This egg is done from a snippet

Installation

In your settings.py

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',

    #.....................#

    'multiselectfield',
)

In your models.py

from multiselectfield import MultiSelectField

...

MY_CHOICES = (('item_key1', 'Item title1'),
              ('item_key2', 'Item title2'),
              ('item_key3', 'Item title3'),
              ('item_key4', 'Item title4'),
              ('item_key5', 'Item title5'))

class MyModel(models.Model):

    .....

    my_field = MultiSelectField(choices=MY_CHOICES, max_length=20)

Development

You can get the last bleeding edge version of django-configfield by doing a clone of its git repository:

git clone https://github.com/goinnn/django-multiselectfield

0.0.3 (2013-09-11)

  • Python 3 compatible

  • Fix an error, the snippet had another error when the choices were translatables

  • Improvements in the README file

0.0.2 (2012-09-28)

  • Fix an error, the snippet had an error.

0.0.1 (2012-09-27)

  • Initial version from the next snippet

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-multiselectfield-0.0.3.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file django-multiselectfield-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-multiselectfield-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cd95f5e605378b87c47c80d5a5fbf900eef3a6a3128008bef67d6ca625b5a914
MD5 e2bd1c18d0f7dc682824754a4ebe023c
BLAKE2b-256 75d49b26fd7561284d1af555779a7ac6c39250a40d2f6a365b87f7e67a6e26e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page