class documentation

class SelectDateWidget(Widget):

View In Hierarchy

A widget that splits date input into three <select> boxes.

This also serves as an example of a Widget that has more than one HTML element and hence implements value_from_datadict.

Static Method ​_parse​_date​_fmt Undocumented
Method __init__ Undocumented
Method format​_value Return a dict containing the year, month, and day of the current value. Use dict instead of a datetime to allow invalid dates such as February 31 to display correctly.
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 date​_re Undocumented
Class Variable day​_field Undocumented
Class Variable input​_type Undocumented
Class Variable month​_field Undocumented
Class Variable none​_value Undocumented
Class Variable template​_name Undocumented
Class Variable year​_field Undocumented
Instance Variable attrs Undocumented
Instance Variable day​_none​_value Undocumented
Instance Variable month​_none​_value Undocumented
Instance Variable months Undocumented
Instance Variable year​_none​_value Undocumented
Instance Variable years Undocumented

Inherited from Widget:

Method __deepcopy__ Undocumented
Method ​_render Undocumented
Method build​_attrs Build an attribute dictionary.
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 needs​_multipart​_form Undocumented
Class Variable supports​_microseconds Undocumented
Property is​_hidden Undocumented
@staticmethod
def _parse_date_fmt():

Undocumented

def __init__(self, attrs=None, years=None, months=None, empty_label=None):

Undocumented

def format_value(self, value):
Return a dict containing the year, month, and day of the current value. Use dict instead of a datetime to allow invalid dates such as February 31 to display correctly.
def get_context(self, name, value, attrs):
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 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.
def value_omitted_from_data(self, data, files, name):
date_re =

Undocumented

day_field: str =

Undocumented

input_type: str =

Undocumented

month_field: str =

Undocumented

none_value: tuple[str, ...] =

Undocumented

template_name: str =

Undocumented

year_field: str =

Undocumented

attrs =

Undocumented

day_none_value =

Undocumented

month_none_value =

Undocumented

months =

Undocumented

year_none_value =

Undocumented

years =

Undocumented