File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
docs_src/tutorial/create_db_and_table/annotations/en Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 66
774 . Create the ` id ` field:
88
9- It could be ` None ` until the database assigns a value to it, so we annotate it with ` Optional ` .
9+ It could be ` None ` until the database assigns a value to it, so we annotate it with ` Optional ` ( ` int | None ` in Python 3.10+) .
1010
1111 It is a ** primary key** , so we use ` Field() ` and the argument ` primary_key=True ` .
1212
2424
2525 In the database, the default value will be ` NULL ` , the SQL equivalent of ` None ` .
2626
27- As this field could be ` None ` (and ` NULL ` in the database), we annotate it with ` Optional ` .
27+ As this field could be ` None ` (and ` NULL ` in the database), we annotate it with ` Optional ` ( ` int | None ` in Python 3.10+) .
2828
29298 . Write the name of the database file.
30309 . Use the name of the database file to create the database URL.
You can’t perform that action at this time.
0 commit comments