- changed status to resolved
`AttributeError` when chaining `select_from` and `with_parent`
Issue #3606
resolved
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)
-
repo owner -
repo owner - Fixed bug where use of the :meth:
.Query.select_from
method would cause a subsequent call to the :meth:.Query.with_parent
method to fail. fixes#3606 - add mark-as-fail test for
#3607
(cherry picked from commit 7d96ad4d535dc02a8ab1384df1db94dea2a045b5)
→ <<cset 609d7bf8fbad>>
- Fixed bug where use of the :meth:
-
repo owner thanks for reporting!
- Log in to comment
.Query.select_from
method would cause a subsequent call to the :meth:.Query.with_parent
method to fail. fixes#3606#3607→ <<cset 7d96ad4d535d>>