You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with QuerySelectMultipleField , the empty form works ok,
but when the edit form is built from an object like form = MyForm(obj=obj) then the multiple select field does not show the selected field.
In other words it always shows none of the options to be selected but in reality there could be some of them selected.
BTW, thanks a lot for the work here, I really appreciate that.
I've used most of this code in my project (which I need to put a reference it was used from this project), the reason I didn't directly use wtforms-sqlalchemy was that I wanted to support SQLAlchemy > 1.4 .
When working with
QuerySelectMultipleField
, the empty form works ok,but when the edit form is built from an object like
form = MyForm(obj=obj)
then the multiple select field does not show the selected field.In other words it always shows none of the options to be
selected
but in reality there could be some of them selected.I think the fix is in the
data
property here:https://github.com/wtforms/wtforms-sqlalchemy/blob/c0d741429407f0bbd2e66e28528e0bada4769ac4/wtforms_sqlalchemy/fields.py#L166-L179
Which instead should be like:
I don't know if a PR for this would be accepted or not, I could do that anyway.
The text was updated successfully, but these errors were encountered: