`AttributeError` when chaining `select_from` and `with_parent`

Issue #3606 resolved
Yegor Roganov created an issue

Given 1-N relationship

class Parent(Base):
    __tablename__ = 'parent'
    id = Column(Integer, primary_key=True)
    children = relationship("Child")

class Child(Base):
    __tablename__ = 'child'
    id = Column(Integer, primary_key=True)
    parent_id = Column(Integer, ForeignKey('parent.id'))

query

session.query(Child.id).select_from(Child).with_parent(parent)

raises

AttributeError: type object 'Child' has no attribute 'class_'

Comments (3)

  1. Log in to comment