使用outerjoin
instances = db.session.query(Instance.name, Instance.sep_status, User.email).outerjoin( User, Instance.user_id==User.id).filter(Instance.is_terminated==0)
for instance in instances.all():
pass
但是还没搞清究竟怎么搞才对于mysql的inner join ,left,right