Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 971 - 980 of 2,110 for py$ (0.04 seconds)

  1. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    例如,你可以用这种方式创建一个数据库会话,并在完成后将其关闭。
    
    在创建响应之前,只会执行 `yield` 语句及其之前的代码:
    
    {* ../../docs_src/dependencies/tutorial007_py310.py hl[2:4] *}
    
    `yield` 产生的值会注入到 *路径操作* 和其他依赖项中:
    
    {* ../../docs_src/dependencies/tutorial007_py310.py hl[4] *}
    
    `yield` 语句后面的代码会在响应之后执行:
    
    {* ../../docs_src/dependencies/tutorial007_py310.py hl[5:6] *}
    
    /// tip | 提示
    
    你可以使用 `async` 或普通函数。
    
    **FastAPI** 会像处理普通依赖一样对它们进行正确处理。
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 12.1K bytes
    - Click Count (0)
  2. docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md

    {* ../../docs_src/dependencies/tutorial002_an_py310.py hl[11:15] *}
    
    클래스의 인스턴스를 만들 때 사용하는 `__init__` 메서드에 주목하세요:
    
    {* ../../docs_src/dependencies/tutorial002_an_py310.py hl[12] *}
    
    ...이전의 `common_parameters`와 동일한 매개변수를 가지고 있습니다:
    
    {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[8] *}
    
    이 매개변수들이 **FastAPI**가 의존성을 "해결"하는 데 사용할 것들입니다.
    
    두 경우 모두 다음을 갖게 됩니다:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:57:01 GMT 2026
    - 8K bytes
    - Click Count (0)
  3. docs/ko/docs/tutorial/body-updates.md

    {* ../../docs_src/body_updates/tutorial002_py310.py hl[32] *}
    
    ### Pydantic의 `update` 파라미터 사용하기 { #using-pydantics-update-parameter }
    
    이제 `.model_copy()`를 사용해 기존 모델의 복사본을 만들고, 업데이트할 데이터가 들어있는 `dict`를 `update` 파라미터로 전달할 수 있습니다.
    
    예: `stored_item_model.model_copy(update=update_data)`:
    
    {* ../../docs_src/body_updates/tutorial002_py310.py hl[33] *}
    
    ### 부분 업데이트 요약 { #partial-updates-recap }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 4.8K bytes
    - Click Count (0)
  4. docs/zh-hant/docs/how-to/custom-request-and-route.md

    {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[14,16] *}
    
    若發生例外,`Request` 實例依然在作用域內,因此在處理錯誤時我們仍可讀取並使用請求本文:
    
    {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[17:19] *}
    
    ## 在路由器中自訂 `APIRoute` 類別 { #custom-apiroute-class-in-a-router }
    
    你也可以在 `APIRouter` 上設定 `route_class` 參數:
    
    {* ../../docs_src/custom_request_and_route/tutorial003_py310.py hl[26] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 4.2K bytes
    - Click Count (0)
  5. docs/en/docs/advanced/middleware.md

    {* ../../docs_src/advanced_middleware/tutorial001_py310.py hl[2,6] *}
    
    ## `TrustedHostMiddleware` { #trustedhostmiddleware }
    
    Enforces that all incoming requests have a correctly set `Host` header, in order to guard against HTTP Host Header attacks.
    
    {* ../../docs_src/advanced_middleware/tutorial002_py310.py hl[2,6:8] *}
    
    The following arguments are supported:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 4.1K bytes
    - Click Count (0)
  6. docs/zh-hant/docs/advanced/json-base64-bytes.md

    {* ../../docs_src/json_base64_bytes/tutorial001_py310.py ln[1:2,12:16,29,38:41] hl[16] *}
    
    ## Pydantic `bytes` 用於輸入與輸出資料 { #pydantic-bytes-for-input-and-output-data }
    
    當然,你也可以使用同一個以 base64 設定的模型,同時處理輸入(以 `val_json_bytes` 驗證)與輸出(以 `ser_json_bytes` 序列化)的 JSON 資料。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:33:04 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  7. docs/ko/docs/tutorial/stream-json-lines.md

    FastAPI에서 JSON Lines를 스트리밍하려면, *경로 처리 함수*에서 `return`을 사용하는 대신 `yield`로 각 항목을 차례로 생성하면 됩니다.
    
    {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[1:24] hl[24] *}
    
    보내려는 각 JSON 항목의 타입이 `Item`(Pydantic 모델)이고 함수가 async라면, 반환 타입을 `AsyncIterable[Item]`로 선언할 수 있습니다:
    
    {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[1:24] hl[9:11,22] *}
    
    반환 타입을 선언하면 FastAPI가 이를 사용해 데이터를 **검증**하고, OpenAPI에 **문서화**하고, **필터링**하고, Pydantic으로 **직렬화**합니다.
    
    /// tip
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:56:39 GMT 2026
    - 4.8K bytes
    - Click Count (0)
  8. docs/ja/docs/tutorial/header-params.md

    ## `Header`をインポート { #import-header }
    
    まず、`Header`をインポートします:
    
    {* ../../docs_src/header_params/tutorial001_an_py310.py hl[3] *}
    
    ## `Header`のパラメータの宣言 { #declare-header-parameters }
    
    次に、`Path`や`Query`、`Cookie`と同じ構造を用いてヘッダーのパラメータを宣言します。
    
    デフォルト値に加えて、追加の検証パラメータや注釈パラメータをすべて定義できます:
    
    {* ../../docs_src/header_params/tutorial001_an_py310.py hl[9] *}
    
    /// note | 技術詳細
    
    `Header`は`Path`や`Query`、`Cookie`の「姉妹」クラスです。また、同じ共通の`Param`クラスを継承しています。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 16:44:21 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  9. docs/en/docs/how-to/configure-swagger-ui.md

    It includes these default configurations:
    
    {* ../../fastapi/openapi/docs.py ln[9:24] hl[18:24] *}
    
    You can override any of them by setting a different value in the argument `swagger_ui_parameters`.
    
    For example, to disable `deepLinking` you could pass these settings to `swagger_ui_parameters`:
    
    {* ../../docs_src/configure_swagger_ui/tutorial003_py310.py hl[3] *}
    
    ## Other Swagger UI Parameters { #other-swagger-ui-parameters }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2.8K bytes
    - Click Count (0)
  10. docs/en/docs/advanced/events.md

    Let's start with an example and then see it in detail.
    
    We create an async function `lifespan()` with `yield` like this:
    
    {* ../../docs_src/events/tutorial003_py310.py hl[16,19] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 7.8K bytes
    - Click Count (0)
Back to Top