storborg / pyramid_uniform

Form handling for Pyramid
Other
2 stars 2 forks source link

Checkbox state is rendered incorrectly #11

Open storborg opened 7 years ago

storborg commented 7 years ago

The pattern used for data persistence across form submission attempts doesn't really work for checkboxes. Specifically, checkboxes will always be set to the default value passed into the renderer.checkbox() call, regardless of their state in the form.

storborg commented 7 years ago

One way to mitigate this would be to look for any evidence that the form was submitted (e.g. the request method is POST, or other keys are set in the form data) and use that to determine whether or not to use the supplied default value.