我是一个新来的SQLAlchemy,所以请原谅这是一个基本的问题。在
我有一个数据库表properties
(在SQLALchemy中映射为对象Property
),其中包含一个字段MEBID
。我有另一个表mebs
(在SQLAlchemy中映射为MEB
)。我想设置属性.MEBID字段到mebs.id哪里属性.邮政编码== mebs.邮政编码. 在
我可以在SQL中使用命令
update properties, mebs set properties.mebid = mebs.id where mebs.PostCode = properties.PostCode
但我在苦于用SQLAlchemy做这件事。如果我尝试命令
^{pr2}$我明白了
InvalidRequestError: This operation requires only one Table or entity be specified as the target.
我知道这必须是基本的,因为这是一个基本的操作,但不知道是怎么做到的。在
要更新:
相关问题 更多 >
编程相关推荐