FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

📝 Update code examples to Python 3.9 by YuriiMotov · Pull Request #1693 · fastapi/sqlmodel · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
968e4e6
Update `docs_src/tutorial/automatic_id_none_refresh`
YuriiMotov Dec 24, 2025
3d43821
Update `docs_src/tutorial/code_structure`
YuriiMotov Dec 24, 2025
c3fb2ed
Update `docs_src/tutorial/connect`
YuriiMotov Dec 24, 2025
a0da1be
Update `docs_src/tutorial/create_db_and_table`
YuriiMotov Dec 24, 2025
d34d9ec
Update `docs_src/tutorial/delete`
YuriiMotov Dec 24, 2025
d603cc1
Update `docs_src/tutorial/fastapi`
YuriiMotov Dec 24, 2025
fdb770d
Update `docs_src/tutorial/where`
YuriiMotov Dec 24, 2025
4604612
Update `docs_src/tutorial/indexes`
YuriiMotov Dec 24, 2025
9abc261
Update `docs_src/tutorial/insert`
YuriiMotov Dec 24, 2025
45a627b
Update `docs_src/tutorial/many_to_many`
YuriiMotov Dec 24, 2025
496fda3
Update `docs_src/tutorial/offset_and_limit`
YuriiMotov Dec 24, 2025
e9d0655
Update `docs_src/tutorial/one`
YuriiMotov Dec 24, 2025
2955480
Update `docs_src/tutorial/relationship_attributes`
YuriiMotov Dec 24, 2025
e903a19
Update `docs_src/tutorial/select`
YuriiMotov Dec 24, 2025
b25e3a3
Update `docs_src/tutorial/update`
YuriiMotov Dec 24, 2025
fb49224
Update `docs_src/advanced/decimal`
YuriiMotov Dec 25, 2025
2c9dc52
Update `docs_src/advanced/uuid`
YuriiMotov Dec 25, 2025
4de5664
Update `management-tasks.md`
YuriiMotov Dec 25, 2025
05af4de
Fix copying coverage file in `cov_tmp_path` fixture
YuriiMotov Dec 25, 2025
695d448
Merge branch 'drop-python3.8-support' into update-code-examples-to-py…
YuriiMotov Dec 25, 2025
03e7be2
Update `tutorial003.md` annotations for Python 3.10+
YuriiMotov Dec 25, 2025
eec65c6
Remove `needs_py39` marker
YuriiMotov Dec 25, 2025
File filter

Filter by extension

Filter by extension .md  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Update tutorial003.md annotations for Python 3.10+
  • Loading branch information
YuriiMotov committed Dec 25, 2025
commit 03e7be2016bb5d026441bb1507d6d67fa228d509
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

4. Create the `id` field:

It could be `None` until the database assigns a value to it, so we annotate it with `Optional`.
It could be `None` until the database assigns a value to it, so we annotate it with `Optional` (`int | None` in Python 3.10+).

It is a **primary key**, so we use `Field()` and the argument `primary_key=True`.

Expand All @@ -24,7 +24,7 @@

In the database, the default value will be `NULL`, the SQL equivalent of `None`.

As this field could be `None` (and `NULL` in the database), we annotate it with `Optional`.
As this field could be `None` (and `NULL` in the database), we annotate it with `Optional` (`int | None` in Python 3.10+).

8. Write the name of the database file.
9. Use the name of the database file to create the database URL.
Expand Down

Back | FazBrowse Home | New Git URL