From 48af591b2dd1f4c6b87558698f311dd7fe6dbbc0 Mon Sep 17 00:00:00 2001 From: George Brocklehurst Date: Tue, 14 Jul 2015 22:57:23 -0400 Subject: [PATCH] Fixed #25124 -- Eased customization of SelectDateWidget subwidget. --- django/forms/widgets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/forms/widgets.py b/django/forms/widgets.py index c744d090ad..13674e406b 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -935,6 +935,7 @@ class SelectDateWidget(Widget): month_field = '%s_month' day_field = '%s_day' year_field = '%s_year' + select_widget = Select date_re = re.compile(r'(\d{4})-(\d\d?)-(\d\d?)$') @@ -1050,6 +1051,6 @@ class SelectDateWidget(Widget): if not self.is_required: choices.insert(0, none_value) local_attrs = self.build_attrs(id=field % id_) - s = Select(choices=choices) + s = self.select_widget(choices=choices) select_html = s.render(field % name, val, local_attrs) return select_html