]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
📝 Fix ambiguous phrasing regarding `HeroPublicWithTeam` model (#1678)
authorberkaykrc <berkay.kirci@gmail.com>
Mon, 9 Mar 2026 09:37:33 +0000 (12:37 +0300)
committerGitHub <noreply@github.com>
Mon, 9 Mar 2026 09:37:33 +0000 (10:37 +0100)
* docs: Fix ambiguous phrasing regarding HeroPublicWithTeam model

* apply suggestion from Yurii

---------

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
docs/tutorial/fastapi/relationships.md

index f789fd930a2731bc5a760db9a6d8854f9c579b4a..8c69b517762c6de134695a803812d5cfd08a301c 100644 (file)
@@ -146,13 +146,13 @@ 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.
 
 ### 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.