我在用金字塔运行SQLAlchemy。我正在尝试运行具有自定义“join”条件的查询:
DBSession.query(A)\
.outerjoin(A.b, B.a_id == A.id)\
.all();
但是,查询失败,出现以下错误:
AttributeError: Neither 'BinaryExpression' object nor 'Comparator' object has an attribute 'selectable'
问题源于条件,就像我移除它一样,查询工作:
DBSession.query(A)\
.outerjoin(A.b)\
.all();
我不理解这个问题,因为我遵循the documentation中描述的语法:
q = session.query(User).join(Address, User.id==Address.user_id)
有人看到发生了什么吗?
目前没有回答
相关问题 更多 >
编程相关推荐