Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 91 - 100 of 981 for tutorial002_py310 (0.42 seconds)

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

    {* ../../docs_src/body_nested_models/tutorial002_py310.py hl[12] *}
    
    ## Set types { #set-types }
    
    But then we think about it, and realize that tags shouldn't repeat, they would probably be unique strings.
    
    And Python has a special data type for sets of unique items, the `set`.
    
    Then we can declare `tags` as a set of strings:
    
    {* ../../docs_src/body_nested_models/tutorial003_py310.py hl[12] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 6.6K bytes
    - Click Count (0)
  2. docs/ko/docs/tutorial/body-nested-models.md

    마찬가지로 예제에서 `tags`를 구체적으로 "문자열의 리스트"로 만들 수 있습니다:
    
    {* ../../docs_src/body_nested_models/tutorial002_py310.py hl[12] *}
    
    ## 집합 타입 { #set-types }
    
    그런데 생각해보니 태그는 반복되면 안 되고, 아마 고유한 문자열이어야 할 것입니다.
    
    그리고 파이썬에는 고유한 항목들의 집합을 위한 특별한 데이터 타입 `set`이 있습니다.
    
    그렇다면 `tags`를 문자열의 집합으로 선언할 수 있습니다:
    
    {* ../../docs_src/body_nested_models/tutorial003_py310.py hl[12] *}
    
    이렇게 하면 중복 데이터가 있는 요청을 받더라도 고유한 항목들의 집합으로 변환됩니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 7.7K bytes
    - Click Count (0)
  3. docs/en/docs/tutorial/body-multiple-params.md

        "description": "The pretender",
        "price": 42.0,
        "tax": 3.2
    }
    ```
    
    But you can also declare multiple body parameters, e.g. `item` and `user`:
    
    {* ../../docs_src/body_multiple_params/tutorial002_py310.py hl[20] *}
    
    
    In this case, **FastAPI** will notice that there is more than one body parameter in the function (there are two parameters that are Pydantic models).
    
    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)
  4. docs/zh/docs/advanced/middleware.md

    强制所有传入请求必须是 `https` 或 `wss`。
    
    任何传向 `http` 或 `ws` 的请求都会被重定向至安全方案。
    
    {* ../../docs_src/advanced_middleware/tutorial001_py310.py hl[2,6] *}
    
    ## `TrustedHostMiddleware` { #trustedhostmiddleware }
    
    强制所有传入请求都必须正确设置 `Host` 请求头,以防 HTTP 主机头攻击。
    
    {* ../../docs_src/advanced_middleware/tutorial002_py310.py hl[2,6:8] *}
    
    支持以下参数:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  5. docs/zh-hant/docs/how-to/separate-openapi-schemas.md

    ## 作為輸入與輸出的 Pydantic 模型 { #pydantic-models-for-input-and-output }
    
    假設你有一個帶有預設值的 Pydantic 模型,如下所示:
    
    {* ../../docs_src/separate_openapi_schemas/tutorial001_py310.py ln[1:7] hl[7] *}
    
    ### 輸入用模型 { #model-for-input }
    
    如果你把這個模型用作輸入,如下所示:
    
    {* ../../docs_src/separate_openapi_schemas/tutorial001_py310.py ln[1:15] hl[14] *}
    
    ...則 `description` 欄位將不是必填。因為它的預設值是 `None`。
    
    ### 文件中的輸入模型 { #input-model-in-docs }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:15:26 GMT 2026
    - 4.1K bytes
    - Click Count (0)
  6. docs/zh/docs/how-to/separate-openapi-schemas.md

    ## 用于输入和输出的 Pydantic 模型 { #pydantic-models-for-input-and-output }
    
    假设你有一个带有默认值的 Pydantic 模型,例如:
    
    {* ../../docs_src/separate_openapi_schemas/tutorial001_py310.py ln[1:7] hl[7] *}
    
    ### 输入用的模型 { #model-for-input }
    
    如果你像下面这样把该模型用作输入:
    
    {* ../../docs_src/separate_openapi_schemas/tutorial001_py310.py ln[1:15] hl[14] *}
    
    ...那么 `description` 字段将**不是必填项**,因为它的默认值是 `None`。
    
    ### 文档中的输入模型 { #input-model-in-docs }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 13:37:57 GMT 2026
    - 4.3K bytes
    - Click Count (0)
  7. docs/zh-hant/docs/tutorial/body-nested-models.md

    對於具有內部型別的模型屬性,也使用相同的標準語法。
    
    因此,在我們的範例中,可以讓 `tags` 明確成為「字串的列表」:
    
    {* ../../docs_src/body_nested_models/tutorial002_py310.py hl[12] *}
    
    ## 集合型別 { #set-types }
    
    但進一步思考後,我們會意識到 `tags` 不應該重覆,應該是唯一的字串。
    
    而 Python 有一種用於唯一元素集合的特殊資料型別:`set`。
    
    因此我們可以將 `tags` 宣告為字串的 `set`:
    
    {* ../../docs_src/body_nested_models/tutorial003_py310.py hl[12] *}
    
    這樣一來,即使收到包含重覆資料的請求,也會被轉換為由唯一元素組成的 `set`。
    
    之後只要輸出該資料,即使來源有重覆,也會以唯一元素的 `set` 輸出。
    
    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)
  8. docs/en/docs/tutorial/extra-models.md

    That way, we can declare just the differences between the models (with plaintext `password`, with `hashed_password` and without password):
    
    {* ../../docs_src/extra_models/tutorial002_py310.py hl[7,13:14,17:18,21:22] *}
    
    ## `Union` or `anyOf` { #union-or-anyof }
    
    You can declare a response to be the `Union` of two or more types, that means, that the response would be any of them.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 6.7K 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/tutorial/path-operation-configuration.md

    このような場合、タグを`Enum`に格納すると理にかなっています。
    
    **FastAPI** は、プレーンな文字列の場合と同じ方法でそれをサポートしています:
    
    {* ../../docs_src/path_operation_configuration/tutorial002b_py310.py hl[1,8:10,13,18] *}
    
    ## 概要と説明 { #summary-and-description }
    
    `summary`と`description`を追加できます:
    
    {* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[17:18] *}
    
    ## docstringを用いた説明 { #description-from-docstring }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 4.8K bytes
    - Click Count (0)
Back to Top