标签: python join sqlalchemy flask
我有以下加入:
user = User.query.join(UserEmail).filter_by(address = js['email'].lower()).first()
它有效,但我也希望结果行中有UserEmail
我将如何实现这一目标?
答案 0 :(得分:6)
session.query(User, UserEmail).join(UserEmail).filter(...)
结果是(User, UserEmail)
(User, UserEmail)