Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 780 for tutorial005_py310 (0.12 seconds)

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

  1. docs/zh/docs/tutorial/body-nested-models.md

    {* ../../docs_src/body_nested_models/tutorial005_py310.py hl[2,8] *}
    
    该字符串将被检查是否为有效的 URL,并在 JSON Schema / OpenAPI 文档中进行记录。
    
    ## 带有一组子模型的属性 { #attributes-with-lists-of-submodels }
    
    你还可以将 Pydantic 模型用作 `list`、`set` 等的子类型:
    
    {* ../../docs_src/body_nested_models/tutorial006_py310.py hl[18] *}
    
    这将期望(转换,校验,记录文档等)下面这样的 JSON 请求体:
    
    ```JSON hl_lines="11"
    {
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 6.8K bytes
    - Click Count (0)
  2. docs/zh-hant/docs/tutorial/extra-models.md

    同樣地,你可以將回應宣告為物件的 `list`。
    
    為此,使用標準的 Python `list`:
    
    {* ../../docs_src/extra_models/tutorial004_py310.py hl[18] *}
    
    ## 以任意 `dict` 作為回應 { #response-with-arbitrary-dict }
    
    你也可以用一般的任意 `dict` 宣告回應,只需指定鍵和值的型別,而不必使用 Pydantic 模型。
    
    當你事先不知道可用的欄位/屬性名稱(定義 Pydantic 模型所需)時,這很實用。
    
    此時可使用 `dict`:
    
    {* ../../docs_src/extra_models/tutorial005_py310.py hl[6] *}
    
    ## 重點回顧 { #recap }
    
    依情境使用多個 Pydantic 模型並靈活繼承。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 6.3K bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/handling-errors.md

    The `RequestValidationError` contains the `body` it received with invalid data.
    
    You could use it while developing your app to log the body and debug it, return it to the user, etc.
    
    {* ../../docs_src/handling_errors/tutorial005_py310.py hl[14] *}
    
    Now try sending an invalid item like:
    
    ```JSON
    {
      "title": "towel",
      "size": "XL"
    }
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 8.9K bytes
    - Click Count (0)
  4. docs/zh-hant/docs/python-types.md

    ///
    
    ## 動機 { #motivation }
    
    先從一個簡單的例子開始:
    
    {* ../../docs_src/python_types/tutorial001_py310.py *}
    
    執行這個程式會輸出:
    
    ```
    John Doe
    ```
    
    這個函式會做以下事情:
    
    * 接收 `first_name` 與 `last_name`。
    * 用 `title()` 把每個字的第一個字母轉成大寫。
    * 用一個空白把它們<dfn title="把它們合在一起,成為一個。將其中一個的內容接在另一個後面。">串接</dfn>起來。
    
    {* ../../docs_src/python_types/tutorial001_py310.py hl[2] *}
    
    ### 編輯它 { #edit-it }
    
    這是一個非常簡單的程式。
    
    但現在想像你正從零開始寫它。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.7K bytes
    - Click Count (0)
  5. docs/ja/docs/tutorial/handling-errors.md

    `RequestValidationError`には無効なデータを含む`body`が含まれています。
    
    アプリ開発中にボディのログを取ってデバッグしたり、ユーザーに返したりなどに使用することができます。
    
    {* ../../docs_src/handling_errors/tutorial005_py310.py hl[14] *}
    
    ここで、以下のような無効な項目を送信してみてください:
    
    ```JSON
    {
      "title": "towel",
      "size": "XL"
    }
    ```
    
    受信したボディを含むデータが無効であることを示すレスポンスが表示されます:
    
    ```JSON hl_lines="12-15"
    {
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 11.2K bytes
    - Click Count (0)
  6. docs/en/docs/tutorial/response-model.md

    We can instead create an input model with the plaintext password and an output model without it:
    
    {* ../../docs_src/response_model/tutorial003_py310.py hl[9,11,16] *}
    
    Here, even though our *path operation function* is returning the same input user that contains the password:
    
    {* ../../docs_src/response_model/tutorial003_py310.py hl[24] *}
    
    ...we declared the `response_model` to be our model `UserOut`, that doesn't include the password:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 15.5K bytes
    - Click Count (0)
  7. docs/ja/docs/tutorial/body-nested-models.md

    {* ../../docs_src/body_nested_models/tutorial005_py310.py hl[2,8] *}
    
    文字列は有効なURLであることが確認され、そのようにJSON Schema / OpenAPIで文書化されます。
    
    ## サブモデルのリストを持つ属性 { #attributes-with-lists-of-submodels }
    
    Pydanticモデルを`list`や`set`などのサブタイプとして使用することもできます:
    
    {* ../../docs_src/body_nested_models/tutorial006_py310.py hl[18] *}
    
    これは、次のようなJSONボディを期待します(変換、検証、ドキュメントなど):
    
    ```JSON hl_lines="11"
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 8.6K bytes
    - Click Count (0)
  8. docs/zh/docs/python-types.md

    ///
    
    ## 动机 { #motivation }
    
    让我们从一个简单的例子开始:
    
    {* ../../docs_src/python_types/tutorial001_py310.py *}
    
    运行这个程序会输出:
    
    ```
    John Doe
    ```
    
    这个函数做了下面这些事情:
    
    * 接收 `first_name` 和 `last_name`。
    * 通过 `title()` 将每个参数的第一个字母转换为大写。
    * 用一个空格将它们<dfn title="把它们合在一起成为一个,内容一个接在另一个后面。">拼接</dfn>起来。
    
    {* ../../docs_src/python_types/tutorial001_py310.py hl[2] *}
    
    ### 修改它 { #edit-it }
    
    这是一个非常简单的程序。
    
    但现在想象你要从零开始写它。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.6K bytes
    - Click Count (0)
  9. docs/zh-hant/docs/advanced/custom-response.md

    {* ../../docs_src/response_directly/tutorial002_py310.py hl[1,18] *}
    
    ### `HTMLResponse` { #htmlresponse }
    
    接收文字或位元組並回傳 HTML 回應,如上所述。
    
    ### `PlainTextResponse` { #plaintextresponse }
    
    接收文字或位元組並回傳純文字回應。
    
    {* ../../docs_src/custom_response/tutorial005_py310.py hl[2,7,9] *}
    
    ### `JSONResponse` { #jsonresponse }
    
    接收資料並回傳 `application/json` 編碼的回應。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  10. docs/ja/docs/python-types.md

    簡単な例から始めてみましょう:
    
    {* ../../docs_src/python_types/tutorial001_py310.py *}
    
    このプログラムを呼び出すと、以下が出力されます:
    
    ```
    John Doe
    ```
    
    この関数は以下のようなことを行います:
    
    * `first_name` と `last_name` を取得します。
    * `title()` を用いて、それぞれの最初の文字を大文字に変換します。
    * 真ん中にスペースを入れて<dfn title="1つにまとめます。片方の内容をもう片方の後ろに続けます。">連結</dfn>します。
    
    {* ../../docs_src/python_types/tutorial001_py310.py hl[2] *}
    
    ### 編集 { #edit-it }
    
    これはとても簡単なプログラムです。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 14.3K bytes
    - Click Count (0)
Back to Top