From 9f5b8727de0c3c9358a01fe0811145d521bb9633 Mon Sep 17 00:00:00 2001 From: berkaykrc Date: Mon, 15 Dec 2025 23:02:39 +0300 Subject: [PATCH 1/2] docs: Fix ambiguous phrasing regarding HeroPublicWithTeam model --- docs/tutorial/fastapi/relationships.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/fastapi/relationships.md b/docs/tutorial/fastapi/relationships.md index f789fd930a..c818276559 100644 --- a/docs/tutorial/fastapi/relationships.md +++ b/docs/tutorial/fastapi/relationships.md @@ -152,7 +152,7 @@ Instead, here these are only **data models** that will tell FastAPI **which attr ### Reference to Other Models -Also, notice that the field `team` is not declared with this new `TeamPublicWithHeroes`, because that would again create that infinite recursion of data. Instead, we declare it with the normal `TeamPublic` model. +Also, notice that in the `HeroPublicWithTeam` model, the field `team` is not declared with this new `TeamPublicWithHeroes`, because that would again create that infinite recursion of data. Instead, we declare it with the normal `TeamPublic` model. And the same for `TeamPublicWithHeroes`, the model used for the new field `heroes` uses `HeroPublic` to get only each hero's data. From bd4a42d5537251518e8277f191ab67c818da1c4e Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 9 Mar 2026 10:32:04 +0100 Subject: [PATCH 2/2] apply suggestion from Yurii --- docs/tutorial/fastapi/relationships.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/fastapi/relationships.md b/docs/tutorial/fastapi/relationships.md index c818276559..8c69b51776 100644 --- a/docs/tutorial/fastapi/relationships.md +++ b/docs/tutorial/fastapi/relationships.md @@ -146,7 +146,7 @@ Then we do the same for the `TeamPublicWithHeroes`, it **inherits** from `TeamPu ### Data Models Without Relationship Attributes -Now, notice that these new fields `team` and `heroes` are not declared with `Relationship()`, because these are not **table models**, they cannot have **relationship attributes** with the magic access to get that data from the database. +Now, notice that these new fields `team` and `heroes` are not declared with `Relationship()`, because `HeroPublicWithTeam` and `TeamPublicWithHeroes` are not **table models**, they cannot have **relationship attributes** with the magic access to get that data from the database. Instead, here these are only **data models** that will tell FastAPI **which attributes** to get data from and **which data** to get from them.