class MultiWidget(Widget):
Known subclasses: django.contrib.postgres.forms.ranges.RangeWidget
, django.forms.widgets.SplitDateTimeWidget
A widget that is composed of multiple widgets.
In addition to the values added by Widget.get_context(), this widget adds a list of subwidgets to the context as widget['subwidgets']. These can be looped over and rendered like normal widgets.
You'll probably want to use this class with MultiValueField.
Method | __deepcopy__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | _get_media |
Media for a multiwidget is the combination of all media of the subwidgets. |
Method | decompress |
Return a list of decompressed values for the given compressed value. The given value can be assumed to be valid, but not necessarily non-empty. |
Method | get_context |
Undocumented |
Method | id_for_label |
Return the HTML ID attribute of this Widget for use by a <label>, given the ID of the field. Return None if no ID is available. |
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. |
Method | value_omitted_from_data |
Undocumented |
Class Variable | media |
Undocumented |
Class Variable | template_name |
Undocumented |
Instance Variable | widgets |
Undocumented |
Instance Variable | widgets_names |
Undocumented |
Property | is_hidden |
Undocumented |
Property | needs_multipart_form |
Undocumented |
Inherited from Widget
:
Method | _render |
Undocumented |
Method | build_attrs |
Build an attribute dictionary. |
Method | format_value |
Return a value as it should appear when rendered in a template. |
Method | render |
Render the widget as an HTML string. |
Method | subwidgets |
Undocumented |
Method | use_required_attribute |
Undocumented |
Class Variable | is_localized |
Undocumented |
Class Variable | is_required |
Undocumented |
Class Variable | supports_microseconds |
Undocumented |
Instance Variable | attrs |
Undocumented |
django.forms.widgets.Widget.__init__
django.contrib.postgres.forms.ranges.RangeWidget
, django.forms.widgets.SplitDateTimeWidget
Undocumented
django.contrib.postgres.forms.ranges.RangeWidget
, django.forms.widgets.SplitDateTimeWidget
django.forms.widgets.Widget.get_context
django.contrib.admin.widgets.AdminSplitDateTime
Undocumented
django.forms.widgets.Widget.id_for_label
Return the HTML ID attribute of this Widget for use by a <label>, given the ID of the field. Return None if no ID is available.
This hook is necessary because some widgets have multiple HTML elements and, thus, multiple IDs. In that case, this method should return an ID value that corresponds to the first ID in the widget's tags.