更新时间:2023-12-04 11:23:28
为了配合 relationship 与 Query
一样,您需要使用 lazy='dynamic'
对其进行配置.在动态关系加载器中查看更多相关信息:
In order to work with the relationship as with Query
, you need to configure it with lazy='dynamic'
. See more on this in Dynamic Relationship Loaders:
_resources = relationship("EnvironmentResource",
cascade="all, delete-orphan",
lazy='dynamic',
passive_deletes=True)