Browse Source

Remove code examples for Python 3.8 in `query_params`

pull/14510/head
Yurii Motov 7 months ago
parent
commit
17b03b8c9e
  1. 4
      docs/en/docs/tutorial/query-params.md
  2. 0
      docs_src/query_params/tutorial001_py39.py
  3. 0
      docs_src/query_params/tutorial002_py39.py
  4. 0
      docs_src/query_params/tutorial003_py39.py
  5. 0
      docs_src/query_params/tutorial004_py39.py
  6. 0
      docs_src/query_params/tutorial005_py39.py
  7. 0
      docs_src/query_params/tutorial006_py39.py
  8. 13
      docs_src/query_params/tutorial006b.py
  9. 2
      tests/test_tutorial/test_query_params/test_tutorial005.py
  10. 2
      tests/test_tutorial/test_query_params/test_tutorial006.py

4
docs/en/docs/tutorial/query-params.md

@ -2,7 +2,7 @@
When you declare other function parameters that are not part of the path parameters, they are automatically interpreted as "query" parameters. When you declare other function parameters that are not part of the path parameters, they are automatically interpreted as "query" parameters.
{* ../../docs_src/query_params/tutorial001.py hl[9] *} {* ../../docs_src/query_params/tutorial001_py39.py hl[9] *}
The query is the set of key-value pairs that go after the `?` in a URL, separated by `&` characters. The query is the set of key-value pairs that go after the `?` in a URL, separated by `&` characters.
@ -128,7 +128,7 @@ If you don't want to add a specific value but just make it optional, set the def
But when you want to make a query parameter required, you can just not declare any default value: But when you want to make a query parameter required, you can just not declare any default value:
{* ../../docs_src/query_params/tutorial005.py hl[6:7] *} {* ../../docs_src/query_params/tutorial005_py39.py hl[6:7] *}
Here the query parameter `needy` is a required query parameter of type `str`. Here the query parameter `needy` is a required query parameter of type `str`.

0
docs_src/query_params/tutorial001.py → docs_src/query_params/tutorial001_py39.py

0
docs_src/query_params/tutorial002.py → docs_src/query_params/tutorial002_py39.py

0
docs_src/query_params/tutorial003.py → docs_src/query_params/tutorial003_py39.py

0
docs_src/query_params/tutorial004.py → docs_src/query_params/tutorial004_py39.py

0
docs_src/query_params/tutorial005.py → docs_src/query_params/tutorial005_py39.py

0
docs_src/query_params/tutorial006.py → docs_src/query_params/tutorial006_py39.py

13
docs_src/query_params/tutorial006b.py

@ -1,13 +0,0 @@
from typing import Union
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_user_item(
item_id: str, needy: str, skip: int = 0, limit: Union[int, None] = None
):
item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit}
return item

2
tests/test_tutorial/test_query_params/test_tutorial005.py

@ -1,7 +1,7 @@
from dirty_equals import IsDict from dirty_equals import IsDict
from fastapi.testclient import TestClient from fastapi.testclient import TestClient
from docs_src.query_params.tutorial005 import app from docs_src.query_params.tutorial005_py39 import app
client = TestClient(app) client = TestClient(app)

2
tests/test_tutorial/test_query_params/test_tutorial006.py

@ -10,7 +10,7 @@ from ...utils import needs_py310
@pytest.fixture( @pytest.fixture(
name="client", name="client",
params=[ params=[
"tutorial006", pytest.param("tutorial006_py39"),
pytest.param("tutorial006_py310", marks=needs_py310), pytest.param("tutorial006_py310", marks=needs_py310),
], ],
) )

Loading…
Cancel
Save