Coverage for docs_src/tutorial/code_structure/tutorial002_py310/team_model.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 00:02 +0000

1from typing import TYPE_CHECKING 1abc

2 

3from sqlmodel import Field, Relationship, SQLModel 1abc

4 

5if TYPE_CHECKING: 1abc

6 from .hero_model import Hero 

7 

8 

9class Team(SQLModel, table=True): 1abc

10 id: int | None = Field(default=None, primary_key=True) 1abc

11 name: str = Field(index=True) 1abc

12 headquarters: str 1abc

13 

14 heroes: list["Hero"] = Relationship(back_populates="team") 1abc