1.filter用类名.属性名,比较用==,filter_by直接用属性名,比较用=
2.filter不支持组合查询,只能连续调用filter来变相实现。
session.query(Dashboard)
.filter(Dashboard.id.in_(dashboard_ids_int))
.all()
dashboard = (
db.session.query(Dashboard)
.filter_by(id=dashboard_id)
.first()
3.filter 可以像写 sql 的 where 条件那样写 > < 等条件,filter_by不可以
标签:SQLAlchemy,区别,filter,session,dashboard,query,id,Dashboard From: https://www.cnblogs.com/bigleft/p/18160658