class documentation

class Widget:

Known subclasses: django.contrib.gis.forms.widgets.BaseGeometryWidget, django.contrib.admin.widgets.RelatedFieldWidgetWrapper, django.contrib.auth.forms.ReadOnlyPasswordHashWidget, django.contrib.postgres.forms.array.SplitArrayWidget, django.forms.widgets.ChoiceWidget, django.forms.widgets.Input, django.forms.widgets.MultiWidget, django.forms.widgets.SelectDateWidget, django.forms.widgets.Textarea

View In Hierarchy

Undocumented

Method __deepcopy__ Undocumented
Method __init__ Undocumented
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 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 render Render the widget as an HTML string.
Method subwidgets Undocumented
Method use​_required​_attribute Undocumented
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 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 _render(self, template_name, context, renderer=None):

Undocumented

def build_attrs(self, base_attrs, extra_attrs=None):
Build an attribute dictionary.
def id_for_label(self, id_):

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.

def render(self, name, value, attrs=None, renderer=None):
Render the widget as an HTML string.
def subwidgets(self, name, value, attrs=None):

Undocumented

def use_required_attribute(self, initial):
is_localized: bool =

Undocumented

is_required: bool =

Undocumented

supports_microseconds: bool =