Skip to content

mikekeda/django-easy-select2

 
 

Repository files navigation

This is django application that brings select2 widget to select inputs in admin.


Python 3.x pypi Travis Build coverage MIT License

Project aims to support 3.4+ and Django 2.0+.

For Django < 2.0 version support or python-2.x compatibility, please use version 1.3.4 which is the last version to support python-2.x compatibility.

This django library is just a lightweight wrapper on Select2 library and provides easy-to-use basic select2 functionality in a django project. If you need feature-rich solution, i recommend you to look at the latest django-select2 library, which have ajax loading support.

If anyone really wants this functionality in django-easy-select2, please feel free to contribute.

Currently project is not in active development state and is maintained by community. Pull requests are welcomed!

Upgrade notes

For details please read changelog.

How it looks

Select one of existing values with single-valued choice field (ForeignKeyField, for example):

image

Easily select 1 or more "categories" for your project, you can also add a new one in the normal, Django-Admin manner by using the green + button with multiple-valued choice field (ManyToManyField):

image

Quickstart

In your admin.py:

from django.contrib import admin
from easy_select2 import select2_modelform
from polls.models import Poll

PollForm = select2_modelform(Poll, attrs={'width': '250px'})

class PollAdmin(admin.ModelAdmin):
    form = PollForm

Thats all. All your choice widgets are select2 widgets 250px wide.

Documentation

You can read more in the documentation.

About

Select2 input widget for django selectable fields.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 82.3%
  • JavaScript 11.7%
  • HTML 4.4%
  • Shell 1.4%
  • CSS 0.2%