File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
docs_src/tutorial/relationship_attributes/back_populates Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Weapon(SQLModel, table=True):
55 id : int | None = Field (default = None , primary_key = True )
66 name : str = Field (index = True )
77
8- hero : "Hero" = Relationship (back_populates = "weapon" )
8+ owner : "Hero" = Relationship (back_populates = "weapon" )
99
1010
1111class Power (SQLModel , table = True ):
@@ -34,7 +34,7 @@ class Hero(SQLModel, table=True):
3434 team : Team | None = Relationship (back_populates = "heroes" )
3535
3636 weapon_id : int | None = Field (default = None , foreign_key = "weapon.id" )
37- weapon : Weapon | None = Relationship (back_populates = "hero " )
37+ weapon : Weapon | None = Relationship (back_populates = "owner " )
3838
3939 powers : list [Power ] = Relationship (back_populates = "hero" )
4040
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ class Weapon(SQLModel, table=True):
77 id : Optional [int ] = Field (default = None , primary_key = True )
88 name : str = Field (index = True )
99
10- hero : "Hero" = Relationship (back_populates = "weapon" )
10+ owner : "Hero" = Relationship (back_populates = "weapon" )
1111
1212
1313class Power (SQLModel , table = True ):
@@ -36,7 +36,7 @@ class Hero(SQLModel, table=True):
3636 team : Optional [Team ] = Relationship (back_populates = "heroes" )
3737
3838 weapon_id : Optional [int ] = Field (default = None , foreign_key = "weapon.id" )
39- weapon : Optional [Weapon ] = Relationship (back_populates = "hero " )
39+ weapon : Optional [Weapon ] = Relationship (back_populates = "owner " )
4040
4141 powers : list [Power ] = Relationship (back_populates = "hero" )
4242
You can’t perform that action at this time.
0 commit comments