Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 877 for tutorial002 (0.21 sec)

  1. docs/zh/docs/tutorial/dependencies/classes-as-dependencies.md

    ```Python hl_lines="11-15"
    {!> ../../docs_src/dependencies/tutorial002.py!}
    ```
    
    ////
    
    注意用于创建类实例的 `__init__` 方法:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="10"
    {!> ../../docs_src/dependencies/tutorial002_py310.py!}
    ```
    
    ////
    
    //// tab | Python 3.6+
    
    ```Python hl_lines="12"
    {!> ../../docs_src/dependencies/tutorial002.py!}
    ```
    
    ////
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  2. docs/en/docs/how-to/custom-docs-ui-assets.md

        └── swagger-ui.css
    ```
    
    ### Serve the static files
    
    * Import `StaticFiles`.
    * "Mount" a `StaticFiles()` instance in a specific path.
    
    {* ../../docs_src/custom_docs_ui/tutorial002.py hl[7,11] *}
    
    ### Test the static files
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Oct 28 10:42:34 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/body-nested-models.md

    ```Python hl_lines="14"
    {!> ../../docs_src/body_nested_models/tutorial001.py!}
    ```
    
    ////
    
    这将使 `tags` 成为一个由元素组成的列表。不过它没有声明每个元素的类型。
    
    ## 具有子类型的 List 字段
    
    但是 Python 有一种特定的方法来声明具有子类型的列表:
    
    ### 从 typing 导入 `List`
    
    首先,从 Python 的标准库 `typing` 模块中导入 `List`:
    
    ```Python hl_lines="1"
    {!> ../../docs_src/body_nested_models/tutorial002.py!}
    ```
    
    ### 声明具有子类型的 List
    
    要声明具有子类型的类型,例如 `list`、`dict`、`tuple`:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  4. docs/ja/docs/advanced/path-operation-advanced-configuration.md

    {!../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
    ```
    
    ### *path operation関数* の名前をoperationIdとして使用する
    
    APIの関数名を `operationId` として利用したい場合、すべてのAPIの関数をイテレーションし、各 *path operation* の `operationId` を `APIRoute.name` で上書きすれば可能です。
    
    そうする場合は、すべての *path operation* を追加した後に行う必要があります。
    
    ```Python hl_lines="2  12-21  24"
    {!../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
    ```
    
    /// tip | "豆知識"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  5. docs/zh/docs/advanced/path-operation-advanced-configuration.md

    {!../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
    ```
    
    ### 使用 *路径操作函数* 的函数名作为 operationId
    
    如果你想用你的 API 的函数名作为 `operationId` 的名字,你可以遍历一遍 API 的函数名,然后使用他们的 `APIRoute.name` 重写每个 *路径操作* 的 `operation_id`。
    
    你应该在添加了所有 *路径操作* 之后执行此操作。
    
    ```Python hl_lines="2 12 13 14 15 16 17 18 19 20 21 24"
    {!../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
    ```
    
    /// tip
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  6. docs/ko/docs/advanced/response-cookies.md

    # 응답 쿠키
    
    ## `Response` 매개변수 사용하기
    
    *경로 작동 함수*에서 `Response` 타입의 매개변수를 선언할 수 있습니다.
    
    그런 다음 해당 *임시* 응답 객체에서 쿠키를 설정할 수 있습니다.
    
    ```Python hl_lines="1  8-9"
    {!../../docs_src/response_cookies/tutorial002.py!}
    ```
    
    그런 다음 필요한 객체(`dict`, 데이터베이스 모델 등)를 반환할 수 있습니다.
    
    그리고 `response_model`을 선언했다면 반환한 객체를 거르고 변환하는 데 여전히 사용됩니다.
    
    **FastAPI**는 그 *임시* 응답에서 쿠키(또한 헤더 및 상태 코드)를 추출하고, 반환된 값이 포함된 최종 응답에 이를 넣습니다. 이 값은 `response_model`로 걸러지게 됩니다.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 29 10:32:45 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  7. docs/en/docs/how-to/custom-request-and-route.md

    All we need to do is handle the request inside a `try`/`except` block:
    
    {* ../../docs_src/custom_request_and_route/tutorial002.py hl[13,15] *}
    
    If an exception occurs, the`Request` instance will still be in scope, so we can read and make use of the request body when handling the error:
    
    {* ../../docs_src/custom_request_and_route/tutorial002.py hl[16:18] *}
    
    ## Custom `APIRoute` class in a router
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 22:39:38 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/path-operation-configuration.md

    ```Python hl_lines="17  22  27"
    {!../../docs_src/path_operation_configuration/tutorial002.py!}
    ```
    
    OpenAPI 概图会自动添加标签,供 API 文档接口使用:
    
    <img src="/img/tutorial/path-operation-configuration/image01.png">
    
    ## `summary` 和 `description` 参数
    
    路径装饰器还支持 `summary` 和 `description` 这两个参数:
    
    ```Python hl_lines="20-21"
    {!../../docs_src/path_operation_configuration/tutorial003.py!}
    ```
    
    ## 文档字符串(`docstring`)
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  9. docs/pt/docs/how-to/custom-docs-ui-assets.md

    ```
    
    ### Prover os arquivos estáticos
    
    * Importe `StaticFiles`.
    * "Monte" a instância `StaticFiles()` em um caminho específico.
    
    ```Python hl_lines="7  11"
    {!../../docs_src/custom_docs_ui/tutorial002.py!}
    ```
    
    ### Teste os arquivos estáticos
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Oct 18 12:02:35 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  10. docs/de/docs/how-to/custom-docs-ui-assets.md

    ### Die statischen Dateien bereitstellen
    
    * Importieren Sie `StaticFiles`.
    * „Mounten“ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad.
    
    ```Python hl_lines="7  11"
    {!../../docs_src/custom_docs_ui/tutorial002.py!}
    ```
    
    ### Die statischen Dateien testen
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.2K bytes
    - Viewed (0)
Back to top