Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for bhar (0.16 sec)

  1. docs/en/docs/advanced/advanced-dependencies.md

        ```Python hl_lines="16"
        {!> ../../../docs_src/dependencies/tutorial011.py!}
        ```
    
    And that way we are able to "parameterize" our dependency, that now has `"bar"` inside of it, as the attribute `checker.fixed_content`.
    
    ## Use the instance as a dependency
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/advanced-dependencies.md

        ```Python hl_lines="16"
        {!> ../../../docs_src/dependencies/tutorial011.py!}
        ```
    
    Und auf diese Weise können wir unsere Abhängigkeit „parametrisieren“, die jetzt `"bar"` enthält, als das Attribut `checker.fixed_content`.
    
    ## Die Instanz als Abhängigkeit verwenden
    
    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)
  3. docs/zh/docs/advanced/advanced-dependencies.md

    本例中,**FastAPI** 不使用 `__init__`,我们要直接在代码中使用。
    
    ## 创建实例
    
    使用以下代码创建类实例:
    
    ```Python hl_lines="16"
    {!../../../docs_src/dependencies/tutorial011.py!}
    ```
    
    这样就可以**参数化**依赖项,它包含 `checker.fixed_content` 的属性 - `"bar"`。
    
    ## 把实例作为依赖项
    
    然后,不要再在 `Depends(checker)` 中使用 `Depends(FixedContentQueryChecker)`, 而是要使用 `checker`,因为依赖项是类实例 - `checker`,不是类。
    
    处理依赖项时,**FastAPI** 以如下方式调用 `checker`:
    
    ```Python
    checker(q="somequery")
    ```
    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