Skip to content

Commit 3375d1c

Browse files
Update multiple-models.md
1 parent 893f8bd commit 3375d1c

File tree

1 file changed

+2
-61
lines changed

1 file changed

+2
-61
lines changed

docs/tutorial/fastapi/multiple-models.md

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -108,74 +108,15 @@ And we want to have a `HeroPublic` with the `id` field, but this time annotated
108108
## Multiple Models with Duplicated Fields
109109

110110
The simplest way to solve it could be to create **multiple models**, each one with all the corresponding fields:
111-
112-
//// tab | Python 3.10+
113-
114-
```Python hl_lines="5-9 12-15 18-22"
115-
# This would work, but there's a better option below 🚨
116-
117-
# Code above omitted 👆
118-
119-
{!./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py[ln:5-22]!}
120-
121-
# Code below omitted 👇
122-
```
123-
124-
////
125-
126-
//// tab | Python 3.9+
127-
128-
```Python hl_lines="5-9 12-15 18-22"
129-
# This would work, but there's a better option below 🚨
130-
131-
# Code above omitted 👆
132-
133-
{!./docs_src/tutorial/fastapi/multiple_models/tutorial001_py39.py[ln:7-24]!}
134-
135-
# Code below omitted 👇
136-
```
137-
138111
////
139112

140-
//// tab | Python 3.7+
141-
142-
```Python hl_lines="5-9 12-15 18-22"
143-
# This would work, but there's a better option below 🚨
144-
145-
# Code above omitted 👆
146-
147-
{!./docs_src/tutorial/fastapi/multiple_models/tutorial001.py[ln:7-24]!}
148-
149-
# Code below omitted 👇
150-
```
113+
{*./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py ln[5:22] hl[5:9, 12:15, 18:22] *}
151114

152115
////
153116

154117
/// details | 👀 Full file preview
155118

156-
//// tab | Python 3.10+
157-
158-
```Python
159-
{!./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py!}
160-
```
161-
162-
////
163-
164-
//// tab | Python 3.9+
165-
166-
```Python
167-
{!./docs_src/tutorial/fastapi/multiple_models/tutorial001_py39.py!}
168-
```
169-
170-
////
171-
172-
//// tab | Python 3.7+
173-
174-
```Python
175-
{!./docs_src/tutorial/fastapi/multiple_models/tutorial001.py!}
176-
```
177-
178-
////
119+
{* ./docs_src/tutorial/fastapi/multiple_models/tutorial001_py310.py *}
179120

180121
///
181122

0 commit comments

Comments
 (0)