class documentation

class AutocompleteMixin:

Known subclasses: django.contrib.admin.widgets.AutocompleteSelect, django.contrib.admin.widgets.AutocompleteSelectMultiple

View In Hierarchy

Select widget mixin that loads options from AutocompleteJsonView via AJAX.

Renders the necessary data attributes for select2 and adds the static form media.

Method __init__ Undocumented
Method build​_attrs Set select2's AJAX attributes.
Method get​_url Undocumented
Method optgroups Return selected options based on the ModelChoiceIterator.
Class Variable url​_name Undocumented
Instance Variable admin​_site Undocumented
Instance Variable attrs Undocumented
Instance Variable choices Undocumented
Instance Variable db Undocumented
Instance Variable field Undocumented
Instance Variable i18n​_name Undocumented
Property media Undocumented
def __init__(self, field, admin_site, attrs=None, choices=(), using=None):

Undocumented

def build_attrs(self, base_attrs, extra_attrs=None):

Set select2's AJAX attributes.

Attributes can be set using the html5 data attribute. Nested attributes require a double dash as per https://select2.org/configuration/data-attributes#nested-subkey-options

def get_url(self):

Undocumented

def optgroups(self, name, value, attr=None):
Return selected options based on the ModelChoiceIterator.
url_name: str =

Undocumented

admin_site =

Undocumented

attrs =

Undocumented

choices =

Undocumented

db =

Undocumented

field =

Undocumented

i18n_name =

Undocumented

@property
media =

Undocumented