- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 130 for commons (0.17 sec)
-
docs_src/dependencies/tutorial003_an_py310.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[Any, Depends(CommonQueryParams)]): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 655 bytes - Viewed (0) -
docs_src/dependencies/tutorial002.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: CommonQueryParams = Depends(CommonQueryParams)): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 656 bytes - Viewed (0) -
docs_src/dependencies/tutorial003_an.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[Any, Depends(CommonQueryParams)]): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 697 bytes - Viewed (0) -
docs/ru/docs/tutorial/dependencies/classes-as-dependencies.md
## Аннотация типа или `Depends` Обратите внимание, что в приведенном выше коде мы два раза пишем `CommonQueryParams`: === "Python 3.6+ без Annotated" !!! tip "Подсказка" Рекомендуется использовать версию с `Annotated` если возможно. ```Python commons: CommonQueryParams = Depends(CommonQueryParams) ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 12 11:12:19 GMT 2024 - 16.3K bytes - Viewed (0) -
docs_src/dependency_testing/tutorial001_py310.py
app = FastAPI() async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons: dict = Depends(common_parameters)): return {"message": "Hello Items!", "params": commons} @app.get("/users/") async def read_users(commons: dict = Depends(common_parameters)):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 1.4K bytes - Viewed (0) -
docs_src/dependencies/tutorial001_py310.py
app = FastAPI() async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons: dict = Depends(common_parameters)): return commons @app.get("/users/") async def read_users(commons: dict = Depends(common_parameters)):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 404 bytes - Viewed (0) -
docs_src/dependencies/tutorial004_py310.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: CommonQueryParams = Depends()): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 607 bytes - Viewed (0) -
docs_src/dependencies/tutorial002_an_py39.py
self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 677 bytes - Viewed (0) -
docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
{!> ../../../docs_src/dependencies/tutorial002_py310.py!} ``` **FastAPI**는 `CommonQueryParams` 클래스를 호출합니다. 이것은 해당 클래스의 "인스턴스"를 생성하고 그 인스턴스는 함수의 매개변수 `commons`로 전달됩니다. ## 타입 힌팅 vs `Depends` 위 코드에서 `CommonQueryParams`를 두 번 작성한 방식에 주목하십시오: ```Python commons: CommonQueryParams = Depends(CommonQueryParams) ``` 마지막 `CommonQueryParams` 변수를 보면: ```Python ... = Depends(CommonQueryParams) ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Feb 11 13:48:31 GMT 2024 - 8K bytes - Viewed (0) -
docs_src/dependencies/tutorial004.py
self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: CommonQueryParams = Depends()): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit] response.update({"items": items})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 639 bytes - Viewed (0)