Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 41 for Emmons (0.2 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. docs_src/dependency_testing/tutorial001_py310.py

        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)):
        return {"message": "Hello Users!", "params": commons}
    
    
    client = TestClient(app)
    
    
    async def override_dependency(q: str | None = None):
    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)
  6. fastapi/param_functions.py

            return {"q": q, "skip": skip, "limit": limit}
    
    
        @app.get("/items/")
        async def read_items(commons: Annotated[dict, Depends(common_parameters)]):
            return commons
        ```
        """
        return params.Depends(dependency=dependency, use_cache=use_cache)
    
    
    def Security(  # noqa: N802
        dependency: Annotated[
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. docs_src/dependencies/tutorial001_py310.py

        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)
  10. 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)
Back to top