且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

sqlalchemy:'InstrumentedList' 对象没有属性 'filter'

更新时间:2023-12-04 11:23:28

为了配合 relationshipQuery 一样,您需要使用 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)