✏ Fix typo variable in example about relationships and back_populates, always use hero instead of owner (#120)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Saman Nezafat 2022-08-28 01:10:57 +04:30 committed by GitHub
parent 006cf488e8
commit d032c3cfea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ class Hero(SQLModel, table=True):
team: Optional[Team] = Relationship(back_populates="heroes") team: Optional[Team] = Relationship(back_populates="heroes")
weapon_id: Optional[int] = Field(default=None, foreign_key="weapon.id") 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") powers: List[Power] = Relationship(back_populates="hero")