Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 849 for Pydantic (0.18 sec)

  1. docs/pt/docs/tutorial/request-form-models.md

    ```console
    $ pip install python-multipart
    ```
    
    ///
    
    /// note | "Nota"
    
    Isto é suportado desde a versão `0.113.0` do FastAPI. 🤓
    
    ///
    
    ## Modelos Pydantic para Formulários
    
    Você precisa apenas declarar um **modelo Pydantic** com os campos que deseja receber como **campos de formulários**, e então declarar o parâmetro como um `Form`:
    
    //// tab | Python 3.9+
    
    ```Python hl_lines="9-11  15"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  2. fastapi/routing.py

                Any,
                Doc(
                    """
                    The type to use for the response.
    
                    It could be any valid Pydantic *field* type. So, it doesn't have to
                    be a Pydantic model, it could be other things, like a `list`, `dict`,
                    etc.
    
                    It will be used for:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 172.1K bytes
    - Viewed (0)
  3. docs/en/docs/deployment/versions.md

    So, you can just let **FastAPI** use the correct Starlette version.
    
    ## About Pydantic
    
    Pydantic includes the tests for **FastAPI** with its own tests, so new versions of Pydantic (above `1.0.0`) are always compatible with FastAPI.
    
    You can pin Pydantic to any version above `1.0.0` that works for you.
    
    For example:
    
    ```txt
    pydantic>=2.7.0,<3.0.0
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Aug 25 02:44:06 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. docs/en/docs/features.md

    * 100% test coverage.
    * 100% type annotated codebase.
    
    ## Pydantic features
    
    **FastAPI** is fully compatible with (and based on) <a href="https://docs.pydantic.dev/" class="external-link" target="_blank"><strong>Pydantic</strong></a>. So, any additional Pydantic code you have, will also work.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 15 23:30:12 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  9. docs/pl/docs/features.md

    * 100% pokrycie testami.
    * 100% adnotacji typów.
    
    ## Cechy Pydantic
    
    **FastAPI** jest w pełni kompatybilny z (oraz bazuje na) <a href="https://docs.pydantic.dev/" class="external-link" target="_blank"><strong>Pydantic</strong></a>. Tak więc każdy dodatkowy kod Pydantic, który posiadasz, również będzie działał.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/extra-models.md

    {!> ../../docs_src/extra_models/tutorial001.py!}
    ```
    
    ////
    
    ### Про `**user_in.dict()`
    
    #### `.dict()` из Pydantic
    
    `user_in` - это Pydantic-модель класса `UserIn`.
    
    У Pydantic-моделей есть метод `.dict()`, который возвращает `dict` с данными модели.
    
    Поэтому, если мы создадим Pydantic-объект `user_in` таким способом:
    
    ```Python
    user_in = UserIn(username="john", password="secret", email="******@****.***")
    ```
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.5K bytes
    - Viewed (0)
Back to top