Open dwt opened 10 years ago
I was just about to open a ticket for exactly this problem.
In my case I am storing the objects in a database after the validation, and the objects will receive their primary keys. But then, if I am rendering the form, the objects in a SequenceWidget
will not have the new primary key.
As a work-around you can simply create a fresh form object, but it would be nice if validate
would not leave turds in the fields.
I've had this problem in my application, where this is a reduction from.
The problem is that calling
form.validate(post_values)
before callingform.render(app_struct)
leaves turds in the fields (to quote mcdonc from irc). In practice that means that the app_struct from form.render() is ignored for some valuesOn IRC mcdonc pointed to this code as being the offender: https://github.com/Pylons/deform/blob/master/deform/widget.py#L1497
Here's the reduction that shows the issue.