|
11 | 11 | TextInput, DateInput, FileInput, CheckboxInput, MultiWidget,
|
12 | 12 | ClearableFileInput, Select, RadioSelect, CheckboxSelectMultiple
|
13 | 13 | )
|
14 |
| -from django.forms.extras import SelectDateWidget |
| 14 | +# Django 1.9 moved SelectDateWidget to django.forms.widget from |
| 15 | +# django.forms.extras. Django 2.0 will remove the old import location. |
| 16 | +try: |
| 17 | + from django.forms.widgets import SelectDateWidget |
| 18 | +except ImportError: |
| 19 | + from django.forms.extras import SelectDateWidget |
15 | 20 | from django.forms.forms import BaseForm, BoundField
|
16 | 21 | from django.forms.formsets import BaseFormSet
|
17 | 22 | from django.utils.html import conditional_escape, escape, strip_tags
|
@@ -256,6 +261,8 @@ def __init__(self, field, *args, **kwargs):
|
256 | 261 | else:
|
257 | 262 | # Or just set it to empty
|
258 | 263 | self.placeholder = ''
|
| 264 | + if self.placeholder: |
| 265 | + self.placeholder = text_value(mark_safe(self.placeholder)) |
259 | 266 |
|
260 | 267 | self.addon_before = kwargs.get('addon_before', self.widget.attrs.pop('addon_before', ''))
|
261 | 268 | self.addon_after = kwargs.get('addon_after', self.widget.attrs.pop('addon_after', ''))
|
@@ -463,7 +470,7 @@ def append_to_field(self, html):
|
463 | 470 | 'show_help': self.show_help,
|
464 | 471 | }
|
465 | 472 | )
|
466 |
| - html += '<span class="help-block">{help}</span>'.format(help=help_html) |
| 473 | + html += help_html |
467 | 474 | return html
|
468 | 475 |
|
469 | 476 | def get_field_class(self):
|
|
0 commit comments