]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix typo in relationships docs
authorrmn <r.y.t@yandex.ru>
Sat, 16 Jan 2016 18:19:02 +0000 (21:19 +0300)
committerrmn <r.y.t@yandex.ru>
Sat, 16 Jan 2016 18:19:02 +0000 (21:19 +0300)
doc/build/orm/basic_relationships.rst

index acb2dba011d8f7b48bd1450eaa052ebd345fafee..97d3c48f4fc8070894ac5f1dbfecd5e8e4844b66 100644 (file)
@@ -118,7 +118,7 @@ of the relationship. To convert one-to-many into one-to-one::
         __tablename__ = 'child'
         id = Column(Integer, primary_key=True)
         parent_id = Column(Integer, ForeignKey('parent.id'))
-        parent = relationship("Child", back_populates="child")
+        parent = relationship("Parent", back_populates="child")
 
 Or for many-to-one::
 
@@ -131,7 +131,7 @@ Or for many-to-one::
     class Child(Base):
         __tablename__ = 'child'
         id = Column(Integer, primary_key=True)
-        parent = relationship("Child", back_populates="child", uselist=False)
+        parent = relationship("Parent", back_populates="child", uselist=False)
 
 As always, the :paramref:`.relationship.backref` and :func:`.backref` functions
 may be used in lieu of the :paramref:`.relationship.back_populates` approach;