{ "info": { "author": "Frankie Dintino", "author_email": "fdintino@theatlantic.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "django-select2-forms\n####################\n\n.. image:: https://travis-ci.org/theatlantic/django-select2-forms.svg?branch=master\n :target: https://travis-ci.org/theatlantic/django-select2-forms\n\n**django-select2-forms** is a project that makes available Django form\nfields that use the `Select2 javascript\nplugin `_. It was created by\ndevelopers at `The Atlantic `_.\n\nSupport\n=======\n\nBeing that Django added select2 support in 2.0, we will support up to that version\nfor compatibility purposes.\n\n* ~=v2.0.2: Python ~=2.7,~=3.6 | Django >=1.8,<2.1\n* ~=v2.1: Python ~=2.7,>=3.6,<3.8 | Django >=1.11,<2.1\n* ~=v3.0: __Python >=3.6,<3.9 | Django >=2.0,<2.1 (future release)__\n\nInstallation\n============\n\nThe recommended way to install is with pip::\n\n pip install django-select2-forms\n\nor, to install with pip from source::\n\n pip install -e git+git://github.com/theatlantic/django-select2-forms.git#egg=django-select2-forms\n\nIf the source is already checked out, use setuptools::\n\n python setup.py develop\n\nConfiguration\n=============\n\n``django-select2-forms`` serves static assets using\n`django.contrib.staticfiles `_,\nand so requires that ``\"select2\"`` be added to your settings'\n``INSTALLED_APPS``:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n # ...\n 'select2',\n )\n\nTo use django-select2-forms' ajax support, ``'select2.urls'`` must be\nincluded in your urls.py ``urlpatterns``:\n\n.. code-block:: python\n\n urlpatterns = patterns('',\n # ...\n url(r'^select2/', include('select2.urls')),\n )\n\nUsage\n=====\n\nThe simplest way to use ``django-select2-forms`` is to use\n``select2.fields.ForeignKey`` and ``select2.fields.ManyToManyField`` in\nplace of ``django.db.models.ForeignKey`` and\n``django.db.models.ManyToManyField``, respectively. These fields extend\ntheir django equivalents and take the same arguments, along with extra\noptional keyword arguments.\n\nselect2.fields.ForeignKey examples\n----------------------------------\n\nIn the following two examples, an \"entry\" is associated with only one\nauthor. The example below does not use ajax, but instead performs\nautocomplete filtering on the client-side using the ``