Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 107 for Model (0.23 sec)

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

    # Extra Models
    
    Continuing with the previous example, it will be common to have more than one related model.
    
    This is especially the case for user models, because:
    
    * The **input model** needs to be able to have a password.
    * The **output model** should not have a password.
    * The **database model** would probably need to have a hashed password.
    
    !!! danger
        Never store user's plaintext passwords. Always store a "secure hash" that you can then verify.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  2. docs/en/docs/tutorial/testing.md

    !!! info
        Note that the `TestClient` receives data that can be converted to JSON, not Pydantic models.
    
        If you have a Pydantic model in your test and you want to send its data to the application during testing, you can use the `jsonable_encoder` described in [JSON Compatible Encoder](encoder.md){.internal-link target=_blank}.
    
    ## Run it
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/openapi-callbacks.md

    * Sie sollte wahrscheinlich eine Deklaration des Bodys enthalten, die sie erhalten soll, z. B. `body: InvoiceEvent`.
    * Und sie könnte auch eine Deklaration der Response enthalten, die zurückgegeben werden soll, z. B. `response_model=InvoiceEventReceived`.
    
    ```Python hl_lines="16-18  21-22  28-32"
    {!../../../docs_src/openapi_callbacks/tutorial001.py!}
    ```
    
    Es gibt zwei Hauptunterschiede zu einer normalen *Pfadoperation*:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:17:23 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/path-operation-advanced-configuration.md

    ⚫️ 🏆 🚫 🎦 🆙 🧾, ✋️ 🎏 🧰 (✅ 🐉) 🔜 💪 ⚙️ 🎂.
    
    ```Python hl_lines="19-29"
    {!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
    ```
    
    ## 🌖 📨
    
    👆 🎲 ✔️ 👀 ❔ 📣 `response_model` & `status_code` *➡ 🛠️*.
    
    👈 🔬 🗃 🔃 👑 📨 *➡ 🛠️*.
    
    👆 💪 📣 🌖 📨 ⏮️ 👫 🏷, 👔 📟, ♒️.
    
    📤 🎂 📃 📥 🧾 🔃 ⚫️, 👆 💪 ✍ ⚫️ [🌖 📨 🗄](additional-responses.md){.internal-link target=_blank}.
    
    ## 🗄 ➕
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  5. docs/en/docs/release-notes.md

    * Fix type declaration of `response_model` to allow generic Python types as `List[Model]`. Mainly to fix `mypy` for users. PR [#266](https://github.com/tiangolo/fastapi/pull/266).
    
    ## 0.25.0
    
    * Add support for Pydantic's `include`, `exclude`, `by_alias`.
        * Update documentation: [Response Model](https://fastapi.tiangolo.com/tutorial/response-model/#response_model_include-and-response_model_exclude).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  6. docs/en/docs/alternatives.md

    !!! check "Inspired **FastAPI** to"
        Define extra validations for data types using the "default" value of model attributes. This improves editor support, and it was not available in Pydantic before.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  7. docs/ko/docs/tutorial/body.md

    <img src="/img/tutorial/body/image01.png">
    
    이를 필요로 하는 각각의 *경로 작동*내부의 API 문서에도 사용됩니다:
    
    <img src="/img/tutorial/body/image02.png">
    
    ## 편집기 지원
    
    편집기에서, 함수 내에서 타입 힌트와 완성을 어디서나 (만약 Pydantic model 대신에 `dict`을 받을 경우 나타나지 않을 수 있습니다) 받을 수 있습니다:
    
    <img src="/img/tutorial/body/image03.png">
    
    잘못된 타입 연산에 대한 에러 확인도 받을 수 있습니다:
    
    <img src="/img/tutorial/body/image04.png">
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/handling-errors.md

    `RequestValidationError` 是 Pydantic 的 <a href="https://docs.pydantic.dev/latest/concepts/models/#error-handling" class="external-link" target="_blank">`ValidationError`</a> 的子类。
    
    **FastAPI** 调用的就是 `RequestValidationError` 类,因此,如果在 `response_model` 中使用 Pydantic 模型,且数据有错误时,在日志中就会看到这个错误。
    
    但客户端或用户看不到这个错误。反之,客户端接收到的是 HTTP 状态码为 `500` 的「内部服务器错误」。
    
    这是因为在*响应*或代码(不是在客户端的请求里)中出现的 Pydantic `ValidationError` 是代码的 bug。
    
    修复错误时,客户端或用户不能访问错误的内部信息,否则会造成安全隐患。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/sql-databases.md

    这样,而不是仅仅试图从`dict`上 `id` 中获取值,如下所示:
    
    ```Python
    id = data["id"]
    ```
    
    尝试从属性中获取它,如:
    
    ```Python
    id = data.id
    ```
    
    有了这个,Pydantic*模型*与 ORM 兼容,您只需在*路径操作*`response_model`的参数中声明它即可。
    
    您将能够返回一个数据库模型,它将从中读取数据。
    
    #### ORM 模式的技术细节
    
    SQLAlchemy 和许多其他默认情况下是“延迟加载”。
    
    这意味着,例如,除非您尝试访问包含该数据的属性,否则它们不会从数据库中获取关系数据。
    
    例如,访问属性`items`:
    
    ```Python
    current_user.items
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  10. docs/zh/docs/how-to/general.md

    # 通用 - 如何操作 - 诀窍
    
    这里是一些指向文档中其他部分的链接,用于解答一般性或常见问题。
    
    ## 数据过滤 - 安全性
    
    为确保不返回超过需要的数据,请阅读 [教程 - 响应模型 - 返回类型](../tutorial/response-model.md){.internal-link target=_blank} 文档。
    
    ## 文档的标签 - OpenAPI
    
    在文档界面中添加**路径操作**的标签和进行分组,请阅读 [教程 - 路径操作配置 - Tags 参数](../tutorial/path-operation-configuration.md#tags){.internal-link target=_blank} 文档。
    
    ## 文档的概要和描述 - OpenAPI
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 22 23:41:09 GMT 2024
    - 2.1K bytes
    - Viewed (0)
Back to top