Ticket #5991: fix-SelectDateWidget-after-autoescaping.diff

File fix-SelectDateWidget-after-autoescaping.diff, 816 bytes (added by alberto.piai@…, 17 years ago)
Line 
1Index: django/newforms/extras/widgets.py
2===================================================================
3--- django/newforms/extras/widgets.py (revision 6702)
4+++ django/newforms/extras/widgets.py (working copy)
5@@ -6,6 +6,7 @@
6
7 from django.newforms.widgets import Widget, Select
8 from django.utils.dates import MONTHS
9+from django.utils.safestring import mark_safe
10
11 __all__ = ('SelectDateWidget',)
12
13@@ -51,7 +52,7 @@
14 select_html =
15Select(choices=year_choices).render(self.year_field % name, year_val)
16 output.append(select_html)
17
18- return u'\n'.join(output)
19+ return mark_safe(u'\n'.join(output))
20
21 def value_from_datadict(self, data, files, name):
22 y, m, d = data.get(self.year_field % name),
23data.get(self.month_field % name), data.get(self.day_field % name)
24
Back to Top