Open tspng opened 8 months ago
I just saw that some of that behaviour has been previously discussed (https://github.com/wtforms/wtforms/issues/662). I can understand the rationale that by default the user input should be displayed as entered when the form is shown again.
But as far as I know, the field's value can't be changed if the field is re-rendered. Is that correct?
My (ugly) workaround is to set field.raw_data = None
as well as field.data = <NEW VALUE>
.
I think I encountered a bug related to how field values are rendered on numeric fields. I am trying to dynamically change some field values after the form has been submitted. It works on
StringField
s for example but not onIntegerField
s.Actual Behavior
Expected Behavior
Allow setting the field data on numeric fields after
formdata
is processed. So the behaviour is aligned with other non-numeric fields.Problem
Right now, all (or most) numeric fields use
raw_data[0]
if present for the fields value in the rendered HTML output.Environment
EDIT: typo