Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 765 for Pydantics (0.18 sec)

  1. fastapi/encoders.py

    from uuid import UUID
    
    from fastapi.types import IncEx
    from pydantic import BaseModel
    from pydantic.color import Color
    from pydantic.networks import AnyUrl, NameEmail
    from pydantic.types import SecretBytes, SecretStr
    from typing_extensions import Annotated, Doc
    
    from ._compat import PYDANTIC_V2, UndefinedType, Url, _model_dump
    
    
    # Taken from Pydantic v1 as is
    def isoformat(o: Union[datetime.date, datetime.time]) -> str:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/dataclasses.md

    So, even with the code above that doesn't use Pydantic explicitly, FastAPI is using Pydantic to convert those standard dataclasses to Pydantic's own flavor of dataclasses.
    
    And of course, it supports the same:
    
    * data validation
    * data serialization
    * data documentation, etc.
    
    This works the same way as with Pydantic models. And it is actually achieved in the same way underneath, using Pydantic.
    
    !!! info
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/body-updates.md

    ### Using Pydantic's `exclude_unset` parameter
    
    If you want to receive partial updates, it's very useful to use the parameter `exclude_unset` in Pydantic's model's `.model_dump()`.
    
    Like `item.model_dump(exclude_unset=True)`.
    
    !!! info
        In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  4. docs/ko/docs/tutorial/response-model.md

    {!../../../docs_src/response_model/tutorial001.py!}
    ```
    
    !!! note "참고"
        `response_model`은 "데코레이터" 메소드(`get`, `post`, 등)의 매개변수입니다. 모든 매개변수들과 본문(body)처럼 *경로 작동 함수*가 아닙니다.
    
    Pydantic 모델 어트리뷰트를 선언한 것과 동일한 타입을 수신하므로 Pydantic 모델이 될 수 있지만, `List[Item]`과 같이 Pydantic 모델들의 `list`일 수도 있습니다.
    
    FastAPI는 이 `response_model`를 사용하여:
    
    * 출력 데이터를 타입 선언으로 변환.
    * 데이터 검증.
    * OpenAPI *경로 작동*의 응답에 JSON 스키마 추가.
    * 자동 생성 문서 시스템에 사용.
    
    하지만 가장 중요한 것은:
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/body-fields.md

    !!! note "Technical Details"
        Actually, `Query`, `Path` and others you'll see next create objects of subclasses of a common `Param` class, which is itself a subclass of Pydantic's `FieldInfo` class.
    
        And Pydantic's `Field` returns an instance of `FieldInfo` as well.
    
        `Body` also returns objects of a subclass of `FieldInfo` directly. And there are others you will see later that are subclasses of the `Body` class.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/schema-extra-example.md

    === "Pydantic v2"
    
        In Pydantic version 2, you would use the attribute `model_config`, that takes a `dict` as described in <a href="https://docs.pydantic.dev/latest/usage/model_config/" class="external-link" target="_blank">Pydantic's docs: Model Config</a>.
    
        You can set `"json_schema_extra"` with a `dict` containing any additional data you would like to show up in the generated JSON Schema, including `examples`.
    
    === "Pydantic v1"
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/body-nested-models.md

    To see all the options you have, checkout the docs for <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">Pydantic's exotic types</a>. You will see some examples in the next chapter.
    
    For example, as in the `Image` model we have a `url` field, we can declare it to be an instance of Pydantic's `HttpUrl` instead of a `str`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="2  8"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  8. docs/ko/docs/tutorial/extra-data-types.md

        * 생성된 스키마는 이것이 `binary` "형식"의 `str`임을 명시합니다.
    * `Decimal`:
        * 표준 파이썬의 `Decimal`.
        * 요청과 응답에서 `float`와 동일하게 다뤄집니다.
    * 여기에서 모든 유효한 pydantic 데이터 자료형을 확인할 수 있습니다: <a href="https://docs.pydantic.dev/latest/usage/types/types/" class="external-link" target="_blank">Pydantic 데이터 자료형</a>.
    
    ## 예시
    
    위의 몇몇 자료형을 매개변수로 사용하는 *경로 작동* 예시입니다.
    
    === "Python 3.10+"
    
        ```Python hl_lines="1  3  12-16"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 14 02:45:10 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/extra-models.md

        ```
    
    !!! info
        In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
    
        The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
    
    ### About `**user_in.dict()`
    
    #### Pydantic's `.dict()`
    
    `user_in` is a Pydantic model of class `UserIn`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/body-fields.md

        ```
    
    `Field`는 `Query`, `Path`와 `Body`와 같은 방식으로 동작하며, 모두 같은 매개변수들 등을 가집니다.
    
    !!! note "기술적 세부사항"
        실제로 `Query`, `Path`등, 여러분이 앞으로 볼 다른 것들은 공통 클래스인 `Param` 클래스의 서브클래스 객체를 만드는데, 그 자체로 Pydantic의 `FieldInfo` 클래스의 서브클래스입니다.
    
        그리고 Pydantic의 `Field` 또한 `FieldInfo`의 인스턴스를 반환합니다.
    
        `Body` 또한 `FieldInfo`의 서브클래스 객체를 직접적으로 반환합니다. 그리고 `Body` 클래스의 서브클래스인 것들도 여러분이 나중에 보게될 것입니다.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 4.3K bytes
    - Viewed (0)
Back to top