mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-22 15:37:33 +00:00
✏ 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:
parent
006cf488e8
commit
d032c3cfea
@ -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")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user