Pegase745 / sqlalchemy-datatables

SQLAlchemy integration of jQuery DataTables >= 1.10.x (Pyramid and Flask examples)
MIT License
159 stars 67 forks source link

Using flask_sqlalchemy model queries with this. #105

Closed ChuckWoodraska closed 6 years ago

ChuckWoodraska commented 6 years ago

When using flask_sqlalchemy the first element in the result set is a model object which messes up the zipping of the column names to the result value. I was wondering if anyone knew how to deal with this. I can still just do db.session.query().select_from(User) but doing User.query causes it to fail.

ChuckWoodraska commented 6 years ago

If anyone else is looking for an answer, I was able to do it by specifying the columns I wanted with User.query.join(Address).with_entities(User.id, User.name, Address.description, User.created_at).