Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is an alternative approach to handling bound field values during HTML form rendering. Instead of forcing field values to string representations early through
.as_form_field()
(done in 6b08e97) it makes both native and string representations available to form renderer / templates.As mentioned in the commit log, it should fix at least #4120 and #4121; effectively it reverts 6b08e97 but should also handle the cases covered in that commit, at least to a degree provable with the test suite.
I also tried adding some tests for issues I could quickly identify as related (e.g. #3139), as otherwise just plain getting rid of
.as_form_field()
, surprisingly, didn't make any test to start failing. But I'm sure there are more that I have missed.