Here's a general idea of how the models could look like with their password fields and the places where they are used:
-//// tab | Python 3.10+
+{* ../../docs_src/extra_models/tutorial001_py310.py hl[7,9,14,20,22,27:28,31:33,38:39] *}
-```Python hl_lines="7 9 14 20 22 27-28 31-33 38-39"
-{!> ../../docs_src/extra_models/tutorial001_py310.py!}
-```
-
-////
-
-//// tab | Python 3.8+
-
-```Python hl_lines="9 11 16 22 24 29-30 33-35 40-41"
-{!> ../../docs_src/extra_models/tutorial001.py!}
-```
-
-////
/// info
That way, we can declare just the differences between the models (with plaintext `password`, with `hashed_password` and without password):
-//// tab | Python 3.10+
-
-```Python hl_lines="7 13-14 17-18 21-22"
-{!> ../../docs_src/extra_models/tutorial002_py310.py!}
-```
-
-////
-
-//// tab | Python 3.8+
-
-```Python hl_lines="9 15-16 19-20 23-24"
-{!> ../../docs_src/extra_models/tutorial002.py!}
-```
-
-////
+{* ../../docs_src/extra_models/tutorial002_py310.py hl[7,13:14,17:18,21:22] *}
## `Union` or `anyOf`
///
-//// tab | Python 3.10+
-
-```Python hl_lines="1 14-15 18-20 33"
-{!> ../../docs_src/extra_models/tutorial003_py310.py!}
-```
-
-////
+{* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
-//// tab | Python 3.8+
-
-```Python hl_lines="1 14-15 18-20 33"
-{!> ../../docs_src/extra_models/tutorial003.py!}
-```
-
-////
### `Union` in Python 3.10
For that, use the standard Python `typing.List` (or just `list` in Python 3.9 and above):
-//// tab | Python 3.9+
-
-```Python hl_lines="18"
-{!> ../../docs_src/extra_models/tutorial004_py39.py!}
-```
-
-////
+{* ../../docs_src/extra_models/tutorial004_py39.py hl[18] *}
-//// tab | Python 3.8+
-
-```Python hl_lines="1 20"
-{!> ../../docs_src/extra_models/tutorial004.py!}
-```
-
-////
## Response with arbitrary `dict`
In this case, you can use `typing.Dict` (or just `dict` in Python 3.9 and above):
-//// tab | Python 3.9+
-
-```Python hl_lines="6"
-{!> ../../docs_src/extra_models/tutorial005_py39.py!}
-```
-
-////
-
-//// tab | Python 3.8+
-
-```Python hl_lines="1 8"
-{!> ../../docs_src/extra_models/tutorial005.py!}
-```
+{* ../../docs_src/extra_models/tutorial005_py39.py hl[6] *}
-////
## Recap