Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 850 for pydantic (0.09 sec)

  1. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

                        "title": "User",
                        "required": IsOneOf(
                            ["username", "email", "full_name", "disabled"],
                            # TODO: remove when deprecating Pydantic v1
                            ["username"],
                        ),
                        "type": "object",
                        "properties": {
                            "username": {"title": "Username", "type": "string"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Mar 13 19:07:10 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/encoder.md

    # JSON 兼容编码器
    
    在某些情况下,您可能需要将数据类型(如Pydantic模型)转换为与JSON兼容的数据类型(如`dict`、`list`等)。
    
    比如,如果您需要将其存储在数据库中。
    
    对于这种要求, **FastAPI**提供了`jsonable_encoder()`函数。
    
    ## 使用`jsonable_encoder`
    
    让我们假设你有一个数据库名为`fake_db`,它只能接收与JSON兼容的数据。
    
    例如,它不接收`datetime`这类的对象,因为这些对象与JSON不兼容。
    
    因此,`datetime`对象必须将转换为包含<a href="https://en.wikipedia.org/wiki/ISO_8601" class="external-link" target="_blank">ISO格式化</a>的`str`类型对象。
    
    同样,这个数据库也不会接收Pydantic模型(带有属性的对象),而只接收`dict`。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  3. docs/ru/docs/tutorial/body-fields.md

    Таким же способом, как вы объявляете дополнительную валидацию и метаданные в параметрах *функции обработки пути* с помощью функций `Query`, `Path` и `Body`, вы можете объявлять валидацию и метаданные внутри Pydantic моделей, используя функцию `Field` из Pydantic.
    
    ## Импорт `Field`
    
    Сначала вы должны импортировать его:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="2"
    {!> ../../docs_src/body_fields/tutorial001_py310.py!}
    ```
    
    ////
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  4. docs/pt/docs/tutorial/body-nested-models.md

    Para ver todas as opções possíveis, cheque a documentação para os<a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">tipos exoticos do Pydantic</a>. Você verá alguns exemplos no próximo capitulo.
    
    Por exemplo, no modelo `Image` nós temos um campo `url`, nós podemos declara-lo como um `HttpUrl` do Pydantic invés de como uma `str`:
    
    ```Python hl_lines="4  10"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/body.md

    Melhora o suporte do editor para seus modelos Pydantic com::
    
    * completação automática
    * verificação de tipos
    * refatoração
    * buscas
    * inspeções
    
    ///
    
    ## Use o modelo
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  6. docs/pt/docs/features.md

    * 100% do código utilizando _type annotations_.
    
    ## Recursos do Pydantic
    
    **FastAPI** é totalmente compatível com (e baseado no) <a href="https://docs.pydantic.dev/" class="external-link" target="_blank"><strong>Pydantic</strong></a>. Então, qualquer código Pydantic adicional que você tiver, também funcionará.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  7. docs/em/docs/advanced/settings.md

    ## Pydantic `Settings`
    
    👐, Pydantic 🚚 👑 🚙 🍵 👫 ⚒ 👟 ⚪️➡️ 🌐 🔢 ⏮️ <a href="https://docs.pydantic.dev/latest/concepts/pydantic_settings/" class="external-link" target="_blank">Pydantic: ⚒ 🧾</a>.
    
    ### ✍ `Settings` 🎚
    
    🗄 `BaseSettings` ⚪️➡️ Pydantic &amp; ✍ 🎧-🎓, 📶 🌅 💖 ⏮️ Pydantic 🏷.
    
    🎏 🌌 ⏮️ Pydantic 🏷, 👆 📣 🎓 🔢 ⏮️ 🆎 ✍, &amp; 🎲 🔢 💲.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.3K bytes
    - Viewed (0)
  8. docs/es/docs/deployment/versions.md

    ## Acerca de Pydantic
    
    Pydantic incluye los tests para **FastAPI** dentro de sus propios tests, esto significa que las versiones de Pydantic (superiores a `1.0.0`) son compatibles con FastAPI.
    
    Puedes fijar Pydantic a cualquier versión superior a `1.0.0` e inferior a `2.0.0` que funcione para ti.
    
    Por ejemplo:
    
    ```txt
    pydantic>=1.2.0,<2.0.0
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Aug 19 18:15:21 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/extra-data-types.md

        * 在请求和响应中被当作 `str` 处理。
        * 生成的模式将指定这个 `str` 是 `binary` "格式"。
    * `Decimal`:
        * 标准的 Python `Decimal`。
        * 在请求和响应中被当做 `float` 一样处理。
    * 您可以在这里检查所有有效的pydantic数据类型: <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">Pydantic data types</a>.
    
    ## 例子
    
    下面是一个*路径操作*的示例,其中的参数使用了上面的一些类型。
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="1  3  12-16"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/encoder.md

    같은 방식으로 이 데이터베이스는 Pydantic 모델(속성이 있는 객체)을 받지 않고, `dict` 만을 받습니다.
    
    이를 위해 `jsonable_encoder` 를 사용할 수 있습니다.
    
    Pydantic 모델과 같은 객체를 받고 JSON 호환 가능한 버전으로 반환합니다:
    
    ```Python hl_lines="5  22"
    {!../../docs_src/encoder/tutorial001.py!}
    ```
    
    이 예시는 Pydantic 모델을 `dict`로, `datetime` 형식을 `str`로 변환합니다.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.9K bytes
    - Viewed (0)
Back to top