widgets.py

Provides extra HTML Widget classes

class core.widgets.SelectDateWidget(attrs=None, years=None, format=None, required=True)[source]

Bases: django.forms.widgets.Widget

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.

classmethod id_for_label(id_)[source]
Returns:
the label for this widget
value_from_datadict(data, files, name)[source]
Returns:
the values from the post data based associated with this widget
parse_value(val)[source]
Returns:
An dict with month, day, year based on val or an empty dict
parse_format(fmt)[source]

Parse the given format fmt and set the format property.

month_choices(fmt)[source]

Return list of choices (tuple (key, value)) for monthes select.

day_choices(fmt)[source]

Return list of choices (tuple (key, value)) for days select.

year_choices(fmt)[source]

Return list of choices (tuple (key, value)) for years select.