sqlalchemy: 'InstrumentedList' object has no attribute 'filter'
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following 3 classes: class Resource: id = Column(Integer, primary_key=True) path = Column(Text) data = Column(Binary) type = Column(Text) def set_resource(self, path, data, type): self.path = path self.data = data self.type = type class EnvironmentResource(Base, Resource): __tablename__ = 'environment_resources' parent_id = Column(Integer, ForeignKey('environments.id', ondelete='CASCADE')) def __init__(self, path, data, type): self.set_resource(path, data, type) class Environment(Base): __tablename__ = 'environments' id = Column