Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for Model (0.14 sec)

  1. docs/zh/docs/tutorial/body-updates.md

    ```Python hl_lines="34"
    {!../../../docs_src/body_updates/tutorial002.py!}
    ```
    
    ### 使用 Pydantic 的 `update` 参数
    
    接下来,用 `.copy()` 为已有模型创建调用 `update` 参数的副本,该参数为包含更新数据的 `dict`。
    
    例如,`stored_item_model.copy(update=update_data)`:
    
    ```Python hl_lines="35"
    {!../../../docs_src/body_updates/tutorial002.py!}
    ```
    
    ### 更新部分数据小结
    
    简而言之,更新部分数据应:
    
    * 使用 `PATCH` 而不是 `PUT` (可选,也可以用 `PUT`);
    * 提取存储的数据;
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/body-updates.md

    Wenn Sie Teil-Aktualisierungen entgegennehmen, ist der `exclude_unset`-Parameter in der `.model_dump()`-Methode von Pydantic-Modellen sehr nützlich.
    
    Wie in `item.model_dump(exclude_unset=True)`.
    
    !!! info
        In Pydantic v1 hieß diese Methode `.dict()`, in Pydantic v2 wurde sie deprecated (aber immer noch unterstützt) und in `.model_dump()` umbenannt.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:26:37 GMT 2024
    - 6.5K bytes
    - Viewed (0)
  3. docs/ru/docs/tutorial/body-updates.md

    ### Использование параметра `update` в Pydantic
    
    Теперь можно создать копию существующей модели, используя `.copy()`, и передать параметр `update` с `dict`, содержащим данные для обновления.
    
    Например, `stored_item_model.copy(update=update_data)`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="33"
        {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
        ```
    
    === "Python 3.9+"
    
        ```Python hl_lines="35"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 23 13:55:32 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/body-updates.md

    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()`.
    
        The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/body-updates.md

        {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
        ```
    
    ### ⚙️ Pydantic `update` 🔢
    
    🔜, 👆 💪 ✍ 📁 ♻ 🏷 ⚙️ `.copy()`, & 🚶‍♀️ `update` 🔢 ⏮️ `dict` ⚗ 💽 ℹ.
    
    💖 `stored_item_model.copy(update=update_data)`:
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
        ```Python hl_lines="35"
        {!> ../../../docs_src/body_updates/tutorial002.py!}
        ```
    
    === "🐍 3️⃣.9️⃣ & 🔛"
    
        ```Python hl_lines="35"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/body-updates.md

    ```Python hl_lines="34"
    {!../../../docs_src/body_updates/tutorial002.py!}
    ```
    
    ### Pydanticの`update`パラメータ
    
    ここで、`.copy()`を用いて既存のモデルのコピーを作成し、`update`パラメータに更新するデータを含む`dict`を渡すことができます。
    
    `stored_item_model.copy(update=update_data)`のように:
    
    ```Python hl_lines="35"
    {!../../../docs_src/body_updates/tutorial002.py!}
    ```
    
    ### 部分的更新のまとめ
    
    まとめると、部分的な更新を適用するには、次のようにします:
    
    * (オプションで)`PUT`の代わりに`PATCH`を使用します。
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.2K bytes
    - Viewed (0)
Back to top