I am trying to have a select field filled with the results of a sqlalchemy request in a flask form.
Here are the code :
def possible_book():
retu
One possible problem is that wtforms.ext.sqlalchemy.fields.QuerySelectField expects a SQLAlchemy query object, not a materialized list. Simply remove the all() call from your possible_book return to return an unmaterialized query to WTForms:
def possible_book():
return Book.query.with_entities(Book.id)