Skip to content

Commit a174b24

Browse files
committed
📝 Fix duplicate single lines
1 parent ff0e6e3 commit a174b24

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/tutorial/fastapi/multiple-models.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Let's check that in detail.
137137

138138
Now we use the type annotation `HeroCreate` for the request JSON data in the `hero` parameter of the **path operation function**.
139139

140-
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[45,45:45] hl[45] *}
140+
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[45] hl[45] *}
141141

142142
Then we create a new `Hero` (this is the actual **table** model that saves things to the database) using `Hero.model_validate()`.
143143

@@ -151,15 +151,15 @@ In versions of **SQLModel** before `0.0.14` you would use the method `.from_orm(
151151

152152
We can now create a new `Hero` instance (the one for the database) and put it in the variable `db_hero` from the data in the `hero` variable that is the `HeroCreate` instance we received from the request.
153153

154-
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[47,47:47] hl[47] *}
154+
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[47] hl[47] *}
155155

156156
Then we just `add` it to the **session**, `commit`, and `refresh` it, and finally, we return the same `db_hero` variable that has the just refreshed `Hero` instance.
157157

158158
Because it is just refreshed, it has the `id` field set with a new ID taken from the database.
159159

160160
And now that we return it, FastAPI will validate the data with the `response_model`, which is a `HeroPublic`:
161161

162-
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[44,44:44] hl[44] *}
162+
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[44] hl[44] *}
163163

164164
This will validate that all the data that we promised is there and will remove any data we didn't declare.
165165

docs/tutorial/fastapi/simple-hero-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ We will start with the **simplest version**, with just heroes (no teams yet).
3232

3333
This is almost the same code we have seen up to now in previous examples:
3434

35-
{* ./docs_src/tutorial/fastapi/simple_hero_api/tutorial001_py310.py ln[2,2:2,5:20] hl[18:19] *}
35+
{* ./docs_src/tutorial/fastapi/simple_hero_api/tutorial001_py310.py ln[2,5:20] hl[18:19] *}
3636

3737
There's only one change here from the code we have used before, the `check_same_thread` in the `connect_args`.
3838

@@ -60,7 +60,7 @@ We will import the `FastAPI` class from `fastapi`.
6060

6161
And then create an `app` object that is an instance of that `FastAPI` class:
6262

63-
{* ./docs_src/tutorial/fastapi/simple_hero_api/tutorial001_py310.py ln[1:2,23,23:23] hl[1,23] *}
63+
{* ./docs_src/tutorial/fastapi/simple_hero_api/tutorial001_py310.py ln[1:2,23] hl[1,23] *}
6464

6565
## Create Database and Tables on `startup`
6666

docs/tutorial/relationship-attributes/read-relationships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ But now that we have the **relationship attributes**, we can just access them, a
2222

2323
So, the highlighted block above, has the same results as the block below:
2424

25-
{* ./docs_src/tutorial/relationship_attributes/read_relationships/tutorial001_py310.py ln[94:98,105,105:105] hl[105] *}
25+
{* ./docs_src/tutorial/relationship_attributes/read_relationships/tutorial001_py310.py ln[94:98,105] hl[105] *}
2626

2727
/// tip
2828

0 commit comments

Comments
 (0)