django_choices_js API

apps

class django_choices_js.apps.DjangoChoicesJsConfig(app_name, app_module)[source]

Bases: AppConfig

name = 'django_choices_js'

forms

class django_choices_js.forms.ChoicesJsMixin(choices_opts: dict = None, *args, **kwargs)[source]

Bases: object

The base class of all Choices.js widgets.

This adds the media property that includes all necessary css and js tags for Choices.js.

Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

build_attrs(base_attrs, extra_attrs=None)[source]
property media
class django_choices_js.forms.ChoicesJsTextInput(choices_opts: dict = None, *args, **kwargs)[source]

Bases: ChoicesJsMixin, TextInput

A widget for text input that allows multiple entries separated by a delimiter (default ',').

Example:

text = django.forms.CharField(widget=django_choices_js.ChoicesJsTextInput, choices_opts={'maxItemCount': 3})
Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

property media
class django_choices_js.forms.ChoicesJsSelect(choices_opts: dict = None, *args, **kwargs)[source]

Bases: ChoicesJsMixin, Select

Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

property media
class django_choices_js.forms.ChoicesJsSelectMultiple(choices_opts: dict = None, *args, **kwargs)[source]

Bases: ChoicesJsMixin, SelectMultiple

Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

property media
class django_choices_js.forms.ChoicesJsModelMixin(choices_opts=None, *args, **kwargs)[source]

Bases: ChoicesJsMixin

Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

build_attrs(base_attrs, extra_attrs=None)[source]
optgroups(name, value, attrs=None)[source]
class django_choices_js.forms.ChoicesJSModelSelect(choices_opts=None, *args, **kwargs)[source]

Bases: ChoicesJsModelMixin, Select

Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

property media
class django_choices_js.forms.ChoicesJSModelSelectMultiple(choices_opts=None, *args, **kwargs)[source]

Bases: ChoicesJsModelMixin, SelectMultiple

Parameters:

choices_opts (dict) – Options that are passed directly to the Choices.js constructor.

property media

models

django_choices_js.models.autocomplete_model(fields, path=None, permission=None)[source]

urls

views

django_choices_js.views.autocomplete(req: WSGIRequest, path)[source]