Say I have a TypedMultipleChoiceField and I'm building a custom select multiple widget in my template.
If I want to check a box based on an initial value (ie. default checked options), OR check a box based on form data that has been returned (ie. error state), I would do this:
<input type="checkbox" {% if form.field.value %}checked{% endif %}>
HOWEVER, {{form.field.value}} source documentation (boundfield.py) states: "Returns the value for this BoundField, using the initial value if the form is not bound or the data otherwise."
So basically the equivalent of:
return (form.field.data or form.field.initial)
Wouldn't it be more appropriate and useful for boundfield.value to return CLEANED data that has gone through to_python()? As in:
return (form.field.cleaned_data or form.field.initial)