@@ -110,7 +110,7 @@ And we want to have a `HeroPublic` with the `id` field, but this time annotated
110110The simplest way to solve it could be to create ** multiple models** , each one with all the corresponding fields:
111111////
112112
113- {* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[ 5:22] hl[ 5:9, 12:15, 18:22] * }
113+ {* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[ 5:22] hl[ 5:9,12:15,18:22] * }
114114
115115////
116116
@@ -140,65 +140,13 @@ Let's now see how to use these new models in the FastAPI application.
140140
141141Let's first check how is the process to create a hero now:
142142
143- //// tab | Python 3.10+
144-
145- ``` Python hl_lines="3-4 6"
146- # Code above omitted 👆
147-
148- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001_py310.py[ln:44 - 51 ]!}
149-
150- # Code below omitted 👇
151- ```
152-
153- ////
154-
155- //// tab | Python 3.9+
156-
157- ``` Python hl_lines="3-4 6"
158- # Code above omitted 👆
159-
160- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001_py39.py[ln:46 - 53 ]!}
161-
162- # Code below omitted 👇
163- ```
164-
165- ////
166-
167- //// tab | Python 3.7+
168-
169- ``` Python hl_lines="3-4 6"
170- # Code above omitted 👆
171-
172- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001.py[ln:46 - 53 ]!}
173-
174- # Code below omitted 👇
175- ```
143+ {* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[ 44:51] hl[ 3:4, 6] * }
176144
177145////
178146
179147/// details | 👀 Full file preview
180148
181- //// tab | Python 3.10+
182-
183- ``` Python
184- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001_py310.py!}
185- ```
186-
187- ////
188-
189- //// tab | Python 3.9+
190-
191- ``` Python
192- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001_py39.py!}
193- ```
194-
195- ////
196-
197- //// tab | Python 3.7+
198-
199- ``` Python
200- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001.py!}
201- ```
149+ {* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py * }
202150
203151////
204152
@@ -208,39 +156,7 @@ Let's check that in detail.
208156
209157Now we use the type annotation ` HeroCreate ` for the request JSON data in the ` hero ` parameter of the ** path operation function** .
210158
211- //// tab | Python 3.10+
212-
213- ``` Python hl_lines="3"
214- # Code above omitted 👆
215-
216- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001_py310.py[ln:45 ]!}
217-
218- # Code below omitted 👇
219- ```
220-
221- ////
222-
223- //// tab | Python 3.9+
224-
225- ``` Python hl_lines="3"
226- # Code above omitted 👆
227-
228- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001_py39.py[ln:47 ]!}
229-
230- # Code below omitted 👇
231- ```
232-
233- ////
234-
235- //// tab | Python 3.7+
236-
237- ``` Python hl_lines="3"
238- # Code above omitted 👆
239-
240- {!./ docs_src/ tutorial/ fastapi/ multiple_models/ tutorial001.py[ln:47 ]!}
241-
242- # Code below omitted 👇
243- ```
159+ {* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[ 45] * }
244160
245161////
246162
0 commit comments