Ticket #1314 (closed defect: fixed)
SelectionField does not format values being rendered in template
|Reported by:||rick446||Owned by:||anonymous|
As documented in this thread, the SelectionField "values" parameter expects a list of the form [(value, display, attrs)] where value is a "Python" value, in the FormEncode sense. The template, then, should render that value to the <option> list using the SelectionField validator's from_python method. Furthermore, when a SelectionField is checking to see if a particular option is selected, it should not do any validator conversion, since it is comparing two "Python" values.
I have attached a patch (with a test) which converts outgoing SelectionField values and sets the "selected" attribute on the options correctly.
- Status changed from closed to reopened
- Resolution fixed deleted
- Summary changed from [PATCH] SelectionField does not format values being rendered in template to SelectionField does not format values being rendered in template
comment:11 Changed 7 years ago by Chris Arndt
- Priority changed from low to normal
- Keywords needs confirmation added
- Milestone changed from 1.1.x bugfix to 1.1.1
comment:12 Changed 7 years ago by chrisz
- Status changed from reopened to closed
- Resolution set to fixed