Browse Source

Fixed typos in documentation

pull/14767/head
Vansh 6 months ago
parent
commit
8050a0ce76
  1. 2
      docs/en/docs/tutorial/bigger-applications.md
  2. 2
      docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
  3. 2
      docs/en/docs/tutorial/sql-databases.md
  4. 8
      docs_src/python_types/tutorial011_py39.py

2
docs/en/docs/tutorial/bigger-applications.md

@ -309,7 +309,7 @@ And we can even declare [global dependencies](dependencies/global-dependencies.m
### Import the `APIRouter` { #import-the-apirouter } ### Import the `APIRouter` { #import-the-apirouter }
Now we import the other submodules that have `APIRouter`s: Now we import the other submodules that have `APIRouter`'s:
{* ../../docs_src/bigger_applications/app_an_py39/main.py hl[4:5] title["app/main.py"] *} {* ../../docs_src/bigger_applications/app_an_py39/main.py hl[4:5] title["app/main.py"] *}

2
docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

@ -10,7 +10,7 @@ In the previous example, we were returning a `dict` from our dependency ("depend
But then we get a `dict` in the parameter `commons` of the *path operation function*. But then we get a `dict` in the parameter `commons` of the *path operation function*.
And we know that editors can't provide a lot of support (like completion) for `dict`s, because they can't know their keys and value types. And we know that editors can't provide a lot of support (like completion) for `dict`'s, because they can't know their keys and value types.
We can do better... We can do better...

2
docs/en/docs/tutorial/sql-databases.md

@ -129,7 +129,7 @@ Here we use the `SessionDep` dependency (a `Session`) to add the new `Hero` to t
### Read Heroes { #read-heroes } ### Read Heroes { #read-heroes }
We can **read** `Hero`s from the database using a `select()`. We can include a `limit` and `offset` to paginate the results. We can **read** `Hero`'s from the database using a `select()`. We can include a `limit` and `offset` to paginate the results.
{* ../../docs_src/sql_databases/tutorial001_an_py310.py ln[48:55] hl[51:52,54] *} {* ../../docs_src/sql_databases/tutorial001_an_py310.py ln[48:55] hl[51:52,54] *}

8
docs_src/python_types/tutorial011_py39.py

@ -8,16 +8,16 @@ class User(BaseModel):
id: int id: int
name: str = "John Doe" name: str = "John Doe"
signup_ts: Union[datetime, None] = None signup_ts: Union[datetime, None] = None
friends: list[int] = [] friends: list[int] = [] # List of Integer
external_data = { external_data = {
"id": "123", "id": "123",
"signup_ts": "2017-06-01 12:22", "signup_ts": "2026-01-01 22:22",
"friends": [1, "2", b"3"], "friends": [1, 2, 3],
} }
user = User(**external_data) user = User(**external_data)
print(user) print(user)
# > User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3] # > User id=123 name='John Doe' signup_ts=datetime.datetime(2026, 1, 1, 22, 22) friends=[1, 2, 3]
print(user.id) print(user.id)
# > 123 # > 123

Loading…
Cancel
Save