]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
✏ Fix typo variable in example about relationships and `back_populates`, always use...
authorSaman Nezafat <77416478+onionj@users.noreply.github.com>
Sat, 27 Aug 2022 20:40:57 +0000 (01:10 +0430)
committerGitHub <noreply@github.com>
Sat, 27 Aug 2022 20:40:57 +0000 (20:40 +0000)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs_src/tutorial/relationship_attributes/back_populates/tutorial003.py

index c137f58f6a3ecc1fb2d99864dcd7cc184e92e599..98e197002eef9d0df3cd2ab0b431de96104568fa 100644 (file)
@@ -36,7 +36,7 @@ class Hero(SQLModel, table=True):
     team: Optional[Team] = Relationship(back_populates="heroes")
 
     weapon_id: Optional[int] = Field(default=None, foreign_key="weapon.id")
-    weapon: Optional[Weapon] = Relationship(back_populates="owner")
+    weapon: Optional[Weapon] = Relationship(back_populates="hero")
 
     powers: List[Power] = Relationship(back_populates="hero")