Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 350 for tutorial003_py310 (0.25 sec)

  1. docs/zh/docs/tutorial/extra-models.md

    ///
    
    {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
    
    ## 模型列表
    
    使用同样的方式也可以声明由对象列表构成的响应。
    
    为此,请使用标准的 Python `typing.List`:
    
    {* ../../docs_src/extra_models/tutorial004_py39.py hl[18] *}
    
    ## 任意 `dict` 构成的响应
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/body.md

    Primeiro, você precisa importar `BaseModel` do `pydantic`:
    
    {* ../../docs_src/body/tutorial001_py310.py hl[2] *}
    
    ## Crie seu modelo de dados { #create-your-data-model }
    
    Então você declara seu modelo de dados como uma classe que herda `BaseModel`.
    
    Utilize os tipos Python padrão para todos os atributos:
    
    {* ../../docs_src/body/tutorial001_py310.py hl[5:9] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/extra-models.md

    ///
    
    {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
    
    ### `Union` in Python 3.10 { #union-in-python-3-10 }
    
    In diesem Beispiel übergeben wir `Union[PlaneItem, CarItem]` als Wert des Arguments `response_model`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 24 10:28:19 UTC 2025
    - 8K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/extra-models.md

    ///
    
    {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
    
    ### `Union` в Python 3.10 { #union-in-python-3-10 }
    
    В этом примере мы передаём `Union[PlaneItem, CarItem]` в качестве значения аргумента `response_model`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_header_param_models/test_tutorial003.py

    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from tests.utils import needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial003_py39"),
            pytest.param("tutorial003_py310", marks=needs_py310),
            pytest.param("tutorial003_an_py39"),
            pytest.param("tutorial003_an_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/body-nested-models.md

    对具有子类型的模型属性也使用相同的标准语法。
    
    因此,在我们的示例中,我们可以将 `tags` 明确地指定为一个「字符串列表」:
    
    {* ../../docs_src/body_nested_models/tutorial002_py310.py hl[12] *}
    
    ## Set 类型
    
    但是随后我们考虑了一下,意识到标签不应该重复,它们很大可能会是唯一的字符串。
    
    Python 具有一种特殊的数据类型来保存一组唯一的元素,即 `set`。
    
    然后我们可以导入 `Set` 并将 `tag` 声明为一个由 `str` 组成的 `set`:
    
    {* ../../docs_src/body_nested_models/tutorial003_py310.py hl[12] *}
    
    这样,即使你收到带有重复数据的请求,这些数据也会被转换为一组唯一项。
    
    而且,每当你输出该数据时,即使源数据有重复,它们也将作为一组唯一项输出。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/dependencies/classes-as-dependencies.md

    所以,我们可以将上面的依赖项 "可依赖对象" `common_parameters` 更改为类 `CommonQueryParams`:
    
    {* ../../docs_src/dependencies/tutorial002_py310.py hl[9:13] *}
    
    注意用于创建类实例的 `__init__` 方法:
    
    {* ../../docs_src/dependencies/tutorial002_py310.py hl[10] *}
    
    ...它与我们以前的 `common_parameters` 具有相同的参数:
    
    {* ../../docs_src/dependencies/tutorial001_py310.py hl[6] *}
    
    这些参数就是 **FastAPI** 用来 "处理" 依赖项的。
    
    在两个例子下,都有:
    
    * 一个可选的 `q` 查询参数,是 `str` 类型。
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/extra-models.md

    ///
    
    {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
    
    ### `Union` in Python 3.10 { #union-in-python-3-10 }
    
    In this example we pass `Union[PlaneItem, CarItem]` as the value of the argument `response_model`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 6.9K bytes
    - Viewed (0)
  9. docs/pt/docs/tutorial/extra-models.md

    ///
    
    {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
    
    ### `Union` no Python 3.10 { #union-in-python-3-10 }
    
    Neste exemplo, passamos `Union[PlaneItem, CarItem]` como o valor do argumento `response_model`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 7.5K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/body.md

    ## 모델 사용하기
    
    함수 안에서 모델 객체의 모든 어트리뷰트에 직접 접근 가능합니다:
    
    {* ../../docs_src/body/tutorial002_py310.py hl[19] *}
    
    ## 요청 본문 + 경로 매개변수
    
    경로 매개변수와 요청 본문을 동시에 선언할 수 있습니다.
    
    **FastAPI**는 경로 매개변수와 일치하는 함수 매개변수가 **경로에서 가져와야 한다**는 것을 인지하며, Pydantic 모델로 선언된 그 함수 매개변수는 **요청 본문에서 가져와야 한다**는 것을 인지할 것입니다.
    
    {* ../../docs_src/body/tutorial003_py310.py hl[15:16] *}
    
    ## 요청 본문 + 경로 + 쿼리 매개변수
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 7.8K bytes
    - Viewed (0)
Back to top