class AutocompleteMixin:
Known subclasses: django.contrib.admin.widgets.AutocompleteSelect
, django.contrib.admin.widgets.AutocompleteSelectMultiple
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 |
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