common.widgets module¶
-
class
common.widgets.DateWidget(attrs=None, end=False, required=False)[source]¶ Bases:
django.forms.widgets.WidgetA Widget that splits date input into two <select> boxes for month and year, with ‘day’ defaulting to the first of the month.
Based on SelectDateWidget, in
django/trunk/django/forms/extras/widgets.py
-
none_value= (0, 'Month')¶
-
day_field= '%s_day'¶
-
month_field= '%s_month'¶
-
year_field= '%s_year'¶
-
classmethod
id_for_label(id_)[source]¶ 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.
-
property
media¶
-