mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-11-02 04:06:49 +08: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:
@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user