devices.widgetsΒΆ
This module contains widgets used in the devices app.
ClassesΒΆ
Allows to disable options within a select input. |
Module ContentsΒΆ
- class devices.widgets.DisableSelectOptionsWidget(disabled_values=None, *args, **kwargs)[source]ΒΆ
Bases:
django.forms.SelectAllows to disable options within a select input.
- Parameters:
disabled_values (list[str] | None)
args (Any)
kwargs (Any)
- create_option(name, value, *args, **kwargs)[source]ΒΆ
Creates the options in the select and disables the desired ones.
- Parameters:
name (str) β The name of the option.
value (Any) β The value of the option.
*args (Any) β Positional arguments passed to forms.Select.create_option.
**kwargs (Any) β Positional arguments passed to forms.Select.create_option.
- Returns:
The option dictionary.
- Return type:
dict[str, Any]