🎨 Update docs format and references with pre-commit and Ruff (#667)
This commit is contained in:
parent
7c5894ee75
commit
56f43904c1
@ -84,7 +84,7 @@ In this case, we used `response_model=TeamRead` and `response_model=HeroRead`, s
|
||||
|
||||
# Code here omitted 👈
|
||||
|
||||
{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:159-164]!}
|
||||
{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:158-163]!}
|
||||
|
||||
# Code below omitted 👇
|
||||
```
|
||||
@ -234,7 +234,7 @@ In the case of the hero, this tells FastAPI to extract the `team` too. And in th
|
||||
|
||||
# Code here omitted 👈
|
||||
|
||||
{!./docs_src/tutorial/fastapi/relationships/tutorial001.py[ln:168-173]!}
|
||||
{!./docs_src/tutorial/fastapi/relationships/tutorial001.py[ln:167-172]!}
|
||||
|
||||
# Code below omitted 👇
|
||||
```
|
||||
|
@ -177,7 +177,7 @@ And then we remove the previous `with` block with the old **session**.
|
||||
|
||||
# Code here omitted 👈
|
||||
|
||||
{!./docs_src/tutorial/fastapi/session_with_dependency/tutorial001.py[ln:55-107]!}
|
||||
{!./docs_src/tutorial/fastapi/session_with_dependency/tutorial001.py[ln:55-106]!}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
@ -92,7 +92,7 @@ These are equivalent and very similar to the **path operations** for the **heroe
|
||||
```Python hl_lines="3-9 12-20 23-28 31-47 50-57"
|
||||
# Code above omitted 👆
|
||||
|
||||
{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:139-193]!}
|
||||
{!./docs_src/tutorial/fastapi/teams/tutorial001.py[ln:138-192]!}
|
||||
|
||||
# Code below omitted 👇
|
||||
```
|
||||
|
@ -98,7 +98,6 @@ def update_hero(
|
||||
|
||||
@app.delete("/heroes/{hero_id}")
|
||||
def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
|
||||
|
||||
hero = session.get(Hero, hero_id)
|
||||
if not hero:
|
||||
raise HTTPException(status_code=404, detail="Hero not found")
|
||||
|
@ -136,7 +136,6 @@ def update_hero(
|
||||
|
||||
@app.delete("/heroes/{hero_id}")
|
||||
def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
|
||||
|
||||
hero = session.get(Hero, hero_id)
|
||||
if not hero:
|
||||
raise HTTPException(status_code=404, detail="Hero not found")
|
||||
|
@ -98,7 +98,6 @@ def update_hero(
|
||||
|
||||
@app.delete("/heroes/{hero_id}")
|
||||
def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
|
||||
|
||||
hero = session.get(Hero, hero_id)
|
||||
if not hero:
|
||||
raise HTTPException(status_code=404, detail="Hero not found")
|
||||
|
@ -127,7 +127,6 @@ def update_hero(
|
||||
|
||||
@app.delete("/heroes/{hero_id}")
|
||||
def delete_hero(*, session: Session = Depends(get_session), hero_id: int):
|
||||
|
||||
hero = session.get(Hero, hero_id)
|
||||
if not hero:
|
||||
raise HTTPException(status_code=404, detail="Hero not found")
|
||||
|
Loading…
x
Reference in New Issue
Block a user