﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28502	Select widget doesn't accept non-string as value	Nguyễn Hồng Quân	Srinivas Reddy Thatiparthy	"I made a model, with `age_bracket` field, which accepts values from choices like this:

{{{#!python
AGE_BRACKET = (
    # The value in the first column will be saved in Postgres Range field,
    # so the upper boundary is not counted, i.e for (18, 25) range, the value 25
    # is not counted.
    ((None, 18), _('Under 18')),
    ((18, 25), _('18 - 24')),
    ((25, 36), _('25 - 35')),
    ((36, 46), _('36 - 45')),
    ((46, 56), _('46 - 55')),
    ((46, 66), _('56 - 65')),
    ((66, None), _('Above 65')),
)
}}}

However, when being rendered as form, all values become empty string. This happens since Django 1.11. In Django 1.10, it was OK.
I found the cause is the widget template ''select_option.html''

{{{#!django
<option value=""{{ widget.value|stringformat:'s' }}""{% include ""django/forms/widgets/attrs.html"" %}>{{ widget.label }}</option>
}}}

The `stringformat` filter turns every non-string value to empty string.
My suggestion is that, update  `stringformat` so that it returns `str(value)` if value is not a string. Is it right way to do?
"	Bug	closed	Template system	dev	Normal	fixed	widget filter		Ready for checkin	1	0	0	0	0	0
