Skip to content

Commit bf072b1

Browse files
committed
fix: use X | None syntax instead of Optional in py310 code structure example
1 parent dfc62f0 commit bf072b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs_src/tutorial/code_structure/tutorial002_py310/hero_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Optional
1+
from typing import TYPE_CHECKING
22

33
from sqlmodel import Field, Relationship, SQLModel
44

@@ -13,4 +13,4 @@ class Hero(SQLModel, table=True):
1313
age: int | None = Field(default=None, index=True)
1414

1515
team_id: int | None = Field(default=None, foreign_key="team.id")
16-
team: Optional["Team"] = Relationship(back_populates="heroes")
16+
team: "Team | None" = Relationship(back_populates="heroes")

0 commit comments

Comments
 (0)