class documentation

class ChoiceWidget(Widget):

Known subclasses: django.forms.widgets.RadioSelect, django.forms.widgets.Select

View In Hierarchy

Undocumented

Method __deepcopy__ Undocumented
Method __init__ Undocumented
Method create​_option Undocumented
Method format​_value Return selected values as a list.
Method get​_context Undocumented
Method id​_for​_label Use an incremented id for each option where the main widget references the zero index.
Method optgroups Return a list of optgroups for this widget.
Method options Yield a flat list of options for this widgets.
Method subwidgets Yield all "subwidgets" of this widget. Used to enable iterating options from a BoundField for choice widgets.
Method value​_from​_datadict Given a dictionary of data and this widget's name, return the value of this widget or None if it's not provided.
Class Variable add​_id​_index Undocumented
Class Variable allow​_multiple​_selected Undocumented
Class Variable checked​_attribute Undocumented
Class Variable input​_type Undocumented
Class Variable option​_inherits​_attrs Undocumented
Class Variable option​_template​_name Undocumented
Class Variable template​_name Undocumented
Instance Variable choices Undocumented

Inherited from Widget:

Method ​_render Undocumented
Method build​_attrs Build an attribute dictionary.
Method render Render the widget as an HTML string.
Method use​_required​_attribute Undocumented
Method value​_omitted​_from​_data Undocumented
Class Variable is​_localized Undocumented
Class Variable is​_required Undocumented
Class Variable needs​_multipart​_form Undocumented
Class Variable supports​_microseconds Undocumented
Instance Variable attrs Undocumented
Property is​_hidden Undocumented
def __deepcopy__(self, memo):
def create_option(self, name, value, label, selected, index, subindex=None, attrs=None):

Undocumented

def format_value(self, value):
Return selected values as a list.
def get_context(self, name, value, attrs):
def id_for_label(self, id_, index='0'):
Use an incremented id for each option where the main widget references the zero index.
def optgroups(self, name, value, attrs=None):
Return a list of optgroups for this widget.
def options(self, name, value, attrs=None):
Yield a flat list of options for this widgets.
def subwidgets(self, name, value, attrs=None):
Yield all "subwidgets" of this widget. Used to enable iterating options from a BoundField for choice widgets.
def value_from_datadict(self, data, files, name):
Given a dictionary of data and this widget's name, return the value of this widget or None if it's not provided.
add_id_index: bool =

Undocumented

allow_multiple_selected: bool =
checked_attribute: dict[str, bool] =

Undocumented

input_type =
option_inherits_attrs: bool =

Undocumented

option_template_name =
template_name =
choices =

Undocumented