]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Corrects typo
authorEdouard Berthe <berthe.ed@gmail.com>
Wed, 31 Aug 2016 06:52:48 +0000 (16:52 +1000)
committerGitHub <noreply@github.com>
Wed, 31 Aug 2016 06:52:48 +0000 (16:52 +1000)
This example doesn't work with 'back_populates' because 'parent_associations' and 'child_associations' are not defined in Parent and Child classes respectively.
Alternatively, we could create 'parent_associations' and 'child_associations' into the classes.

doc/build/orm/basic_relationships.rst

index 069f8e73ff0d3d01fbe377de46c4f6d47bb59b93..cd6389ab7ebcf0561e3ba0cea87dc66bcf621719 100644 (file)
@@ -388,8 +388,8 @@ associated object, and a second to a target attribute.
             right_id = Column(Integer, ForeignKey('right.id'), primary_key=True)
             extra_data = Column(String(50))
 
-            child = relationship("Child", back_populates="parent_associations")
-            parent = relationship("Parent", back_populates="child_associations")
+            child = relationship("Child", backref="parent_associations")
+            parent = relationship("Parent", backref="child_associations")
 
         class Parent(Base):
             __tablename__ = 'left'