Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for Timmons (5.53 sec)

  1. 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)
  2. 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)
  3. 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)
  4. tests/test_dependency_overrides.py

    
    @app.get("/main-depends/")
    async def main_depends(commons: dict = Depends(common_parameters)):
        return {"in": "main-depends", "params": commons}
    
    
    @app.get("/decorator-depends/", dependencies=[Depends(common_parameters)])
    async def decorator_depends():
        return {"in": "decorator-depends"}
    
    
    @router.get("/router-depends/")
    async def router_depends(commons: dict = Depends(common_parameters)):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  5. docs/ru/docs/tutorial/dependencies/index.md

    В приведенном выше примере есть небольшое **повторение кода**.
    
    Когда вам нужно использовать `common_parameters()` зависимость, вы должны написать весь параметр с аннотацией типов и `Depends()`:
    
    ```Python
    commons: Annotated[dict, Depends(common_parameters)]
    ```
    
    Но потому что мы используем `Annotated`,  мы можем хранить `Annotated` значение в переменной и использовать его в нескольких местах:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.7K bytes
    - Viewed (0)
  6. docs/de/docs/tutorial/dependencies/index.md

    Wenn Sie die Abhängigkeit `common_parameters()` verwenden, müssen Sie den gesamten Parameter mit der Typannotation und `Depends()` schreiben:
    
    ```Python
    commons: Annotated[dict, Depends(common_parameters)]
    ```
    
    Da wir jedoch `Annotated` verwenden, können wir diesen `Annotated`-Wert in einer Variablen speichern und an mehreren Stellen verwenden:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:01:10 GMT 2024
    - 13.1K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/dependencies/classes-as-dependencies.md

    **FastAPI** ruft die Klasse `CommonQueryParams` auf. Dadurch wird eine „Instanz“ dieser Klasse erstellt und die Instanz wird als Parameter `commons` an Ihre Funktion überreicht.
    
    ## Typannotation vs. `Depends`
    
    Beachten Sie, wie wir `CommonQueryParams` im obigen Code zweimal schreiben:
    
    === "Python 3.8+"
    
        ```Python
        commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
        ```
    
    === "Python 3.8+ nicht annotiert"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:01:58 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  8. docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md

    ```Python hl_lines="19"
    {!../../../docs_src/dependencies/tutorial002.py!}
    ```
    
    **FastAPI** は`CommonQueryParams`クラスを呼び出します。これにより、そのクラスの「インスタンス」が作成され、インスタンスはパラメータ`commons`として関数に渡されます。
    
    ## 型注釈と`Depends`
    
    上のコードでは`CommonQueryParams`を2回書いていることに注目してください:
    
    ```Python
    commons: CommonQueryParams = Depends(CommonQueryParams)
    ```
    
    以下にある最後の`CommonQueryParams`:
    
    ```Python
    ... = Depends(CommonQueryParams)
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jan 15 16:08:16 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/index.md

    When you need to use the `common_parameters()` dependency, you have to write the whole parameter with the type annotation and `Depends()`:
    
    ```Python
    commons: Annotated[dict, Depends(common_parameters)]
    ```
    
    But because we are using `Annotated`, we can store that `Annotated` value in a variable and use it in multiple places:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/dependencies/index.md

    ## `Annotated`인 의존성 공유하기
    
    위의 예제에서 몇몇 작은 **코드 중복**이 있다는 것을 보았을 겁니다.
    
    `common_parameters()`의존을 사용해야 한다면, 타입 명시와 `Depends()`와 함께 전체 매개변수를 적어야 합니다:
    
    ```Python
    commons: Annotated[dict, Depends(common_parameters)]
    ```
    
    하지만 `Annotated`를 사용하고 있기에, `Annotated` 값을 변수에 저장하고 여러 장소에서 사용할 수 있습니다:
    
    === "Python 3.10+"
    
        ```Python hl_lines="12  16  21"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13.6K bytes
    - Viewed (0)
Back to top