📝 Update includes in `docs/en/docs/tutorial/encoder.md` (#12597)

This commit is contained in:
Tony Ly 2024-10-27 16:31:16 -07:00 committed by GitHub
parent dbc3008f5a
commit 96a6d469e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 15 deletions

View File

@ -20,21 +20,7 @@ You can use `jsonable_encoder` for that.
It receives an object, like a Pydantic model, and returns a JSON compatible version:
//// tab | Python 3.10+
```Python hl_lines="4 21"
{!> ../../docs_src/encoder/tutorial001_py310.py!}
```
////
//// tab | Python 3.8+
```Python hl_lines="5 22"
{!> ../../docs_src/encoder/tutorial001.py!}
```
////
{* ../../docs_src/encoder/tutorial001_py310.py hl[4,21] *}
In this example, it would convert the Pydantic model to a `dict`, and the `datetime` to a `str`.