Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 207 for advanced (0.05 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

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

    # Advanced Dependencies { #advanced-dependencies }
    
    ## Parameterized dependencies { #parameterized-dependencies }
    
    All the dependencies we have seen are a fixed function or class.
    
    But there could be cases where you want to be able to set parameters on the dependency, without having to declare many different functions or classes.
    
    Let's imagine that we want to have a dependency that checks if the query parameter `q` contains some fixed content.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 9K bytes
    - Click Count (0)
  2. docs/en/docs/advanced/advanced-python-types.md

    # Advanced Python Types { #advanced-python-types }
    
    Here are some additional ideas that might be useful when working with Python types.
    
    ## Using `Union` or `Optional` { #using-union-or-optional }
    
    If your code for some reason can't use `|`, for example if it's not in a type annotation but in something like `response_model=`, instead of using the vertical bar (`|`) you can use `Union` from `typing`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:32:12 GMT 2026
    - 2K bytes
    - Click Count (0)
  3. docs/zh-hant/docs/advanced/advanced-python-types.md

    # 進階 Python 型別 { #advanced-python-types }
    
    以下是一些在使用 Python 型別時可能有用的額外想法。
    
    ## 使用 `Union` 或 `Optional` { #using-union-or-optional }
    
    如果你的程式碼因某些原因無法使用 `|`,例如不是在型別註記中,而是在像 `response_model=` 之類的參數位置,那麼你可以用 `typing` 中的 `Union` 來取代豎線(`|`)。
    
    例如,你可以宣告某個值可以是 `str` 或 `None`:
    
    ```python
    from typing import Union
    
    
    def say_hi(name: Union[str, None]):
            print(f"Hi {name}!")
    ```
    
    在 `typing` 中也有用 `Optional` 宣告某個值可以是 `None` 的速記法。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:15:26 GMT 2026
    - 1.9K bytes
    - Click Count (0)
  4. docs/en/docs/advanced/path-operation-advanced-configuration.md

    # Path Operation Advanced Configuration { #path-operation-advanced-configuration }
    
    ## OpenAPI operationId { #openapi-operationid }
    
    /// warning
    
    If you are not an "expert" in OpenAPI, you probably don't need this.
    
    ///
    
    You can set the OpenAPI `operationId` to be used in your *path operation* with the parameter `operation_id`.
    
    You would have to make sure that it is unique for each operation.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 7.1K bytes
    - Click Count (0)
  5. docs/zh/docs/advanced/advanced-python-types.md

    # 高级 Python 类型 { #advanced-python-types }
    
    这里有一些在使用 Python 类型时可能有用的额外想法。
    
    ## 使用 `Union` 或 `Optional` { #using-union-or-optional }
    
    如果你的代码因为某些原因不能使用 `|`,例如它不是在类型注解里,而是在 `response_model=` 之类的参数中,那么你可以使用 `typing` 中的 `Union` 来代替竖线(`|`)。
    
    例如,你可以声明某个值可以是 `str` 或 `None`:
    
    ```python
    from typing import Union
    
    
    def say_hi(name: Union[str, None]):
            print(f"Hi {name}!")
    ```
    
    `typing` 也提供了一个声明“可能为 `None`”的快捷方式:`Optional`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 13:37:57 GMT 2026
    - 2K bytes
    - Click Count (0)
  6. docs/ja/docs/advanced/advanced-python-types.md

    # 高度な Python の型 { #advanced-python-types }
    
    Python の型を扱うときに役立つ追加のアイデアをいくつか紹介します。
    
    ## `Union` または `Optional` の利用 { #using-union-or-optional }
    
    何らかの理由で `|` が使えない場合、たとえば型アノテーションではなく `response_model=` のような場所では、縦棒(`|`)の代わりに `typing` の `Union` を使えます。
    
    例えば、`str` または `None` になり得ることを宣言できます:
    
    ```python
    from typing import Union
    
    
    def say_hi(name: Union[str, None]):
            print(f"Hi {name}!")
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 15:24:30 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  7. docs/zh/docs/advanced/path-operation-advanced-configuration.md

    # 路径操作的高级配置 { #path-operation-advanced-configuration }
    
    ## OpenAPI 的 operationId { #openapi-operationid }
    
    /// warning
    
    如果你并非 OpenAPI 的“专家”,你可能不需要这部分内容。
    
    ///
    
    你可以在 *路径操作* 中通过参数 `operation_id` 设置要使用的 OpenAPI `operationId`。
    
    务必确保每个操作的 `operation_id` 都是唯一的。
    
    {* ../../docs_src/path_operation_advanced_configuration/tutorial001_py310.py hl[6] *}
    
    ### 使用 *路径操作函数* 的函数名作为 operationId { #using-the-path-operation-function-name-as-the-operationid }
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 6.7K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/advanced/path-operation-advanced-configuration.md

    # 路徑操作進階設定 { #path-operation-advanced-configuration }
    
    ## OpenAPI operationId { #openapi-operationid }
    
    /// warning
    
    如果你不是 OpenAPI 的「專家」,大概不需要這個。
    
    ///
    
    你可以用參數 `operation_id` 為你的*路徑操作(path operation)*設定要使用的 OpenAPI `operationId`。
    
    你必須確保每個操作的 `operationId` 都是唯一的。
    
    {* ../../docs_src/path_operation_advanced_configuration/tutorial001_py310.py hl[6] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 6.5K bytes
    - Click Count (0)
  9. docs/zh/docs/advanced/advanced-dependencies.md

    # 高级依赖项 { #advanced-dependencies }
    
    ## 参数化的依赖项 { #parameterized-dependencies }
    
    目前我们看到的依赖项都是固定的函数或类。
    
    但有时你可能希望为依赖项设置参数,而不必声明许多不同的函数或类。
    
    假设我们要有一个依赖项,用来检查查询参数 `q` 是否包含某个固定内容。
    
    但我们希望能够把这个固定内容参数化。
    
    ## “可调用”的实例 { #a-callable-instance }
    
    在 Python 中,可以让某个类的实例变成“可调用对象”(callable)。
    
    这里指的是类的实例(类本身已经是可调用的),而不是类本身。
    
    为此,声明一个 `__call__` 方法:
    
    {* ../../docs_src/dependencies/tutorial011_an_py310.py hl[12] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 8.1K bytes
    - Click Count (0)
  10. docs/es/docs/advanced/advanced-dependencies.md

    # Dependencias Avanzadas { #advanced-dependencies }
    
    ## Dependencias con parámetros { #parameterized-dependencies }
    
    Todas las dependencias que hemos visto son una función o clase fija.
    
    Pero podría haber casos en los que quieras poder establecer parámetros en la dependencia, sin tener que declarar muchas funciones o clases diferentes.
    
    Imaginemos que queremos tener una dependencia que revise si el parámetro de query `q` contiene algún contenido fijo.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 9.7K bytes
    - Click Count (0)
Back to Top