Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 510 for tutorial004_an_py310 (0.12 seconds)

  1. docs/ko/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

    {* ../../docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py hl[1,4] *}
    
    ### v2 안의 Pydantic v1에 대한 FastAPI 지원 { #fastapi-support-for-pydantic-v1-in-v2 }
    
    FastAPI 0.119.0부터는 v2로의 마이그레이션을 쉽게 하기 위해, Pydantic v2 내부의 Pydantic v1에 대해서도 부분적인 지원이 있습니다.
    
    따라서 Pydantic을 최신 v2로 업그레이드하고, import를 `pydantic.v1` 서브모듈을 사용하도록 바꾸면, 많은 경우 그대로 동작합니다.
    
    {* ../../docs_src/pydantic_v1_in_v2/tutorial002_an_py310.py hl[2,5,15] *}
    
    /// warning | 경고
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 6.3K bytes
    - Click Count (0)
  2. docs/zh-hant/docs/tutorial/security/oauth2-jwt.md

    定義一個用於權杖端點回應的 Pydantic Model。
    
    建立一個工具函式來產生新的 access token。
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[4,7,13:15,29:31,82:90] *}
    
    ## 更新相依項目 { #update-the-dependencies }
    
    更新 `get_current_user`,讓它仍接收相同的權杖,但這次改用 JWT 權杖。
    
    解碼收到的權杖、驗證它,並回傳目前的使用者。
    
    如果權杖無效,立即回傳一個 HTTP 錯誤。
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[93:110] *}
    
    ## 更新 `/token` 路徑操作 { #update-the-token-path-operation }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.1K bytes
    - Click Count (0)
  3. docs/zh/docs/tutorial/security/oauth2-jwt.md

    定义一个用于令牌端点响应的 Pydantic 模型。
    
    创建一个生成新访问令牌的工具函数。
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[4,7,13:15,29:31,82:90] *}
    
    ## 更新依赖项 { #update-the-dependencies }
    
    更新 `get_current_user` 以接收与之前相同的令牌,但这次使用的是 JWT 令牌。
    
    解码接收到的令牌,进行校验,并返回当前用户。
    
    如果令牌无效,立即返回一个 HTTP 错误。
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[93:110] *}
    
    ## 更新 `/token` 路径操作 { #update-the-token-path-operation }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.1K bytes
    - Click Count (0)
  4. docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

    {* ../../docs_src/pydantic_v1_in_v2/tutorial004_an_py310.py hl[4,18] *}
    
    ### Migrate in steps { #migrate-in-steps }
    
    /// tip
    
    First try with `bump-pydantic`, if your tests pass and that works, then you're done in one command. ✨
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  5. docs/ja/docs/tutorial/security/oauth2-jwt.md

    新しいアクセストークンを生成するユーティリティ関数を作成します。
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[4,7,13:15,29:31,82:90] *}
    
    ## 依存関係の更新 { #update-the-dependencies }
    
    `get_current_user`を更新して、先ほどと同じトークンを受け取るようにしますが、今回はJWTトークンを使用します。
    
    受け取ったトークンをデコードして検証し、現在のユーザーを返します。
    
    トークンが無効な場合は、すぐにHTTPエラーを返します。
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[93:110] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 14.6K bytes
    - Click Count (1)
  6. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    {* ../../docs_src/dependencies/tutorial002_an_py310.py hl[11:15] *}
    
    Pay attention to the `__init__` method used to create the instance of the class:
    
    {* ../../docs_src/dependencies/tutorial002_an_py310.py hl[12] *}
    
    ...it has the same parameters as our previous `common_parameters`:
    
    {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[8] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:32:12 GMT 2026
    - 6.8K bytes
    - Click Count (0)
  7. docs/ko/docs/tutorial/body-multiple-params.md

    기본적으로 단일 값은 쿼리 매개변수로 해석되므로, 명시적으로 `Query`를 추가할 필요 없이 이렇게 하면 됩니다:
    
    ```Python
    q: str | None = None
    ```
    
    예를 들어:
    
    {* ../../docs_src/body_multiple_params/tutorial004_an_py310.py hl[28] *}
    
    
    /// info | 정보
    
    `Body` 또한 `Query`, `Path` 그리고 이후에 볼 다른 것들과 마찬가지로 동일한 추가 검증과 메타데이터 매개변수를 모두 갖고 있습니다.
    
    ///
    
    ## 단일 본문 매개변수 삽입하기 { #embed-a-single-body-parameter }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:57:01 GMT 2026
    - 5.5K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/tutorial/path-params-numeric-validations.md

    {* ../../docs_src/path_params_numeric_validations/tutorial003_an_py310.py hl[10] *}
    
    ## 數值驗證:大於或等於 { #number-validations-greater-than-or-equal }
    
    使用 `Query` 和 `Path`(以及你之後會看到的其他類別)可以宣告數值限制。
    
    這裡用 `ge=1`,代表 `item_id` 必須是「大於(`g`reater)或等於(`e`qual)」`1` 的整數。
    
    {* ../../docs_src/path_params_numeric_validations/tutorial004_an_py310.py hl[10] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  9. docs/en/docs/tutorial/body-multiple-params.md

    ```Python
    q: str | None = None
    ```
    
    For example:
    
    {* ../../docs_src/body_multiple_params/tutorial004_an_py310.py hl[28] *}
    
    
    /// info
    
    `Body` also has all the same extra validation and metadata parameters as `Query`, `Path` and others you will see later.
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:32:12 GMT 2026
    - 4.8K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/tutorial/dependencies/classes-as-dependencies.md

    接著,我們可以把上面的相依項(dependable)`common_parameters` 改成類別 `CommonQueryParams`:
    
    {* ../../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** 會用這些參數來「解析」該相依性。
    
    兩種情況下都會有:
    
    - 一個可選的查詢參數 `q`,型別為 `str`。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:15:26 GMT 2026
    - 6.7K bytes
    - Click Count (0)
Back to Top