diff --git a/docs/tutorial/fastapi/relationships.md b/docs/tutorial/fastapi/relationships.md index 78ef330..6921b5a 100644 --- a/docs/tutorial/fastapi/relationships.md +++ b/docs/tutorial/fastapi/relationships.md @@ -55,11 +55,11 @@ And the same way, we declared the `TeamRead` with only the same base fields of t # Code here omitted 👈 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:32-37]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:31-36]!} # Code here omitted 👈 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:46-47]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:45-46]!} # Code below omitted 👇 ``` @@ -80,11 +80,11 @@ In this case, we used `response_model=TeamRead` and `response_model=HeroRead`, s ```Python hl_lines="3 8 12 17" # Code above omitted 👆 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:105-110]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:104-109]!} # Code here omitted 👈 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:160-165]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:159-164]!} # Code below omitted 👇 ``` diff --git a/docs/tutorial/fastapi/teams.md b/docs/tutorial/fastapi/teams.md index 7a307b8..0b19a95 100644 --- a/docs/tutorial/fastapi/teams.md +++ b/docs/tutorial/fastapi/teams.md @@ -18,8 +18,8 @@ Then we also inherit from the `TeamBase` for the `TeamCreate` and `TeamRead` **d And we also create a `TeamUpdate` **data model**. -```Python hl_lines="7-9 12-15 18-19 22-23 26-29" -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:1-29]!} +```Python hl_lines="7-9 12-15 18-19 22-23 26-28" +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:1-28]!} # Code below omitted 👇 ``` @@ -42,7 +42,7 @@ Let's now update the `Hero` models too. ```Python hl_lines="3-8 11-15 17-18 21-22 25-29" # Code above omitted 👆 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:32-58]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:31-57]!} # Code below omitted 👇 ``` @@ -66,10 +66,10 @@ And even though the `HeroBase` is *not* a **table model**, we can declare `team_ Notice that the **relationship attributes**, the ones with `Relationship()`, are **only** in the **table models**, as those are the ones that are handled by **SQLModel** with SQLAlchemy and that can have the automatic fetching of data from the database when we access them. -```Python hl_lines="11 39" +```Python hl_lines="11 38" # Code above omitted 👆 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:7-58]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:7-57]!} # Code below omitted 👇 ``` @@ -92,7 +92,7 @@ These are equivalent and very similar to the **path operations** for the **heroe ```Python hl_lines="3-9 12-20 23-28 31-47 50-57" # Code above omitted 👆 -{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:140-194]!} +{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:139-193]!} # Code below omitted 👇 ``` diff --git a/docs_src/tutorial/fastapi/teams/tutorial001.py b/docs_src/tutorial/fastapi/teams/tutorial001.py index e8f88b8..2a0bd60 100644 --- a/docs_src/tutorial/fastapi/teams/tutorial001.py +++ b/docs_src/tutorial/fastapi/teams/tutorial001.py @@ -24,7 +24,6 @@ class TeamRead(TeamBase): class TeamUpdate(SQLModel): - id: Optional[int] = None name: Optional[str] = None headquarters: Optional[str] = None diff --git a/tests/test_tutorial/test_fastapi/test_teams/test_tutorial001.py b/tests/test_tutorial/test_fastapi/test_teams/test_tutorial001.py index 852839b..6ac1cff 100644 --- a/tests/test_tutorial/test_fastapi/test_teams/test_tutorial001.py +++ b/tests/test_tutorial/test_fastapi/test_teams/test_tutorial001.py @@ -442,7 +442,6 @@ openapi_schema = { "title": "TeamUpdate", "type": "object", "properties": { - "id": {"title": "Id", "type": "integer"}, "name": {"title": "Name", "type": "string"}, "headquarters": {"title": "Headquarters", "type": "string"}, },