Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 371 for dependencies (0.18 sec)

  1. docs/en/docs/reference/dependencies.md

    # Dependencies - `Depends()` and `Security()`
    
    ## `Depends()`
    
    Dependencies are handled mainly with the special function `Depends()` that takes a callable.
    
    Here is the reference for it and its parameters.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Depends
    ```
    
    ::: fastapi.Depends
    
    ## `Security()`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 671 bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/dependencies/global-dependencies.md

        {!> ../../../docs_src/dependencies/tutorial012_an.py!}
        ```
    
    === "Python 3.8 nicht annotiert"
    
        !!! tip "Tipp"
            Bevorzugen Sie die `Annotated`-Version, falls möglich.
    
        ```Python hl_lines="15"
        {!> ../../../docs_src/dependencies/tutorial012.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:10:13 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/dependencies/global-dependencies.md

        ```
    
    === "Python 3.8 Annotated가 없는 경우"
    
        !!! tip "팁"
            가능하다면 `Annotated`가 달린 버전을 권장합니다.
    
        ```Python hl_lines="15"
        {!> ../../../docs_src/dependencies/tutorial012.py!}
        ```
    
    그리고 [*경로 작동 데코레이터*에 `dependencies` 추가하기](dependencies-in-path-operation-decorators.md){.internal-link target=_blank}에 대한 아이디어는 여전히 적용되지만 여기에서는 앱에 있는 모든 *경로 작동*에 적용됩니다.
    
    ## *경로 작동* 모음에 대한 의존성
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Feb 14 15:05:47 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  4. docs/de/docs/reference/dependencies.md

    Nils Lindemann <******@****.***> 1711822605 +0100
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:16:45 GMT 2024
    - 765 bytes
    - Viewed (0)
  5. docs/de/docs/advanced/advanced-dependencies.md

    Dazu deklarieren wir eine Methode `__call__`:
    
    === "Python 3.9+"
    
        ```Python hl_lines="12"
        {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="11"
        {!> ../../../docs_src/dependencies/tutorial011_an.py!}
        ```
    
    === "Python 3.8+ nicht annotiert"
    
        !!! tip "Tipp"
            Bevorzugen Sie die `Annotated`-Version, falls möglich.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:18:49 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/dependencies/sub-dependencies.md

    ```Python hl_lines="8 9"
    {!../../../docs_src/dependencies/tutorial005.py!}
    ```
    
    これはオプショナルのクエリパラメータ`q`を`str`として宣言し、それを返すだけです。
    
    これは非常にシンプルです(あまり便利ではありません)が、サブ依存関係がどのように機能するかに焦点を当てるのに役立ちます。
    
    ### 第二の依存関係 「依存可能なもの」と「依存」
    
    そして、別の依存関数(「依存可能なもの」)を作成して、同時にそれ自身の依存関係を宣言することができます(つまりそれ自身も「依存」です):
    
    ```Python hl_lines="13"
    {!../../../docs_src/dependencies/tutorial005.py!}
    ```
    
    宣言されたパラメータに注目してみましょう:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jan 15 16:43:41 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/dependencies/sub-dependencies.md

    === "Python 3.10+"
    
        ```Python hl_lines="8-9"
        {!> ../../../docs_src/dependencies/tutorial005_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python hl_lines="8-9"
        {!> ../../../docs_src/dependencies/tutorial005_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="9-10"
        {!> ../../../docs_src/dependencies/tutorial005_an.py!}
        ```
    
    === "Python 3.10 nicht annotiert"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:09:48 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

    ```Python hl_lines="2-4"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    Полученное значение и есть то, что будет внедрено в функцию операции пути и другие зависимости:
    
    ```Python hl_lines="4"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    Код, следующий за оператором `yield`, выполняется после доставки ответа:
    
    ```Python hl_lines="5-6"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    !!! tip "Подсказка"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 04:21:06 GMT 2024
    - 19.6K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    例如,您可以使用这种方式创建一个数据库会话,并在完成后关闭它。
    
    在发送响应之前,只会执行 `yield` 语句及之前的代码:
    
    ```Python hl_lines="2-4"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    生成的值会注入到*路径操作*和其他依赖项中:
    
    ```Python hl_lines="4"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    "yield"语句后面的代码会在发送响应后执行::
    
    ```Python hl_lines="5-6"
    {!../../../docs_src/dependencies/tutorial007.py!}
    ```
    
    !!! tip "提示"
    
        您可以使用 `async` 或普通函数。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/advanced-dependencies.md

    这里说的不是类本身(类本就是可调用项),而是类实例。
    
    为此,需要声明 `__call__` 方法:
    
    ```Python hl_lines="10"
    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    本例中,**FastAPI**  使用 `__call__` 检查附加参数及子依赖项,稍后,还要调用它向*路径操作函数*传递值。
    
    ## 参数化实例
    
    接下来,使用 `__init__` 声明用于**参数化**依赖项的实例参数:
    
    ```Python hl_lines="7"
    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    本例中,**FastAPI** 不使用 `__init__`,我们要直接在代码中使用。
    
    ## 创建实例
    
    使用以下代码创建类实例:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jan 28 18:26:57 GMT 2024
    - 2K bytes
    - Viewed (0)
Back to top