Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Emmons (0.14 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. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

        ```Python
        commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python
        commons: CommonQueryParams = Depends(CommonQueryParams)
        ```
    
    ...you write:
    
    === "Python 3.8+"
    
        ```Python
        commons: Annotated[CommonQueryParams, Depends()]
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
Back to top