wtforms-sqlalchemy icon indicating copy to clipboard operation
wtforms-sqlalchemy copied to clipboard

Allow to override the default blank value "__None"

Open Lukas0907 opened this issue 3 years ago • 0 comments

The sentinel value to detect a blank option is currently __None. This is unfortunately incompatible with select2. select2 expects a blank field to have an empty value. I assume that there are more tools out there with this requirement so I think it would be valuable if this use case was supported by wtforms-sqlalchemy.

This PR adds the keyword argument blank_value to QuerySelectField to make it configurable. It's still __None by default for backwards compatibility.

This is similar to PR #27 but configurable and with tests and documentation.

Lukas0907 avatar Aug 30 '22 08:08 Lukas0907