We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf072b1 commit 68cd4b5Copy full SHA for 68cd4b5
1 file changed
docs_src/tutorial/code_structure/tutorial002_py310/hero_model.py
@@ -1,4 +1,4 @@
1
-from typing import TYPE_CHECKING
+from typing import TYPE_CHECKING, Optional
2
3
from sqlmodel import Field, Relationship, SQLModel
4
@@ -13,4 +13,4 @@ class Hero(SQLModel, table=True):
13
age: int | None = Field(default=None, index=True)
14
15
team_id: int | None = Field(default=None, foreign_key="team.id")
16
- team: "Team | None" = Relationship(back_populates="heroes")
+ team: Optional["Team"] = Relationship(back_populates="heroes")
0 commit comments