Search Options

Results per page
Sort
Preferred Languages
Advance

Results 151 - 160 of 849 for Pydantics (0.1 sec)

  1. docs/uk/docs/tutorial/encoder.md

    Тим самим способом ця база даних не прийматиме об'єкт типу Pydantic model (об'єкт з атрибутами), а лише `dict`.
    
    Ви можете використовувати `jsonable_encoder` для цього.
    
    Вона приймає об'єкт, такий як Pydantic model, і повертає його версію, сумісну з JSON:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="4  21"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  2. tests/test_compat.py

        get_model_fields,
        is_bytes_sequence_annotation,
        is_scalar_field,
        is_uploadfile_sequence_annotation,
    )
    from fastapi.testclient import TestClient
    from pydantic import BaseConfig, BaseModel, ConfigDict
    from pydantic.fields import FieldInfo
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_model_field_default_required():
        # For coverage
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Sep 11 07:45:30 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  3. docs/ja/docs/tutorial/extra-models.md

    ```Python hl_lines="9  11  16  22  24  29-30  33-35  40-41"
    {!../../docs_src/extra_models/tutorial001.py!}
    ```
    
    ### `**user_in.dict()`について
    
    #### Pydanticの`.dict()`
    
    `user_in`は`UserIn`クラスのPydanticモデルです。
    
    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
    - 6.7K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/sql-databases.md

    ## 创建 Pydantic 模型
    
    现在让我们查看一下文件`sql_app/schemas.py`。
    
    /// tip
    
    为了避免 SQLAlchemy*模型*和 Pydantic*模型*之间的混淆,我们将有`models.py`(SQLAlchemy 模型的文件)和`schemas.py`( Pydantic 模型的文件)。
    
    这些 Pydantic 模型或多或少地定义了一个“schema”(一个有效的数据形状)。
    
    因此,这将帮助我们在使用两者时避免混淆。
    
    ///
    
    ### 创建初始 Pydantic*模型*/模式
    
    创建一个`ItemBase`和`UserBase`Pydantic*模型*(或者我们说“schema”),他们拥有创建或读取数据时具有的共同属性。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_schema_extra_example/test_tutorial004_an_py310.py

                                            ],
                                        }
                                    )
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "allOf": [
                                                {"$ref": "#/components/schemas/Item"}
                                            ],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_schema_extra_example/test_tutorial005.py

                                    "schema": IsDict({"$ref": "#/components/schemas/Item"})
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "allOf": [
                                                {"$ref": "#/components/schemas/Item"}
                                            ],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an_py310.py

                                    "schema": IsDict({"$ref": "#/components/schemas/Item"})
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "allOf": [
                                                {"$ref": "#/components/schemas/Item"}
                                            ],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py

                                        }
                                    )
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "$ref": "#/components/schemas/Body_read_items_items__item_id__put"
                                        }
                                    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Apr 19 00:11:40 UTC 2024
    - 7K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

                        "msg": "Field required",
                        "input": None,
                    },
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "item"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  10. .github/workflows/test.yml

            run: uv pip install -r requirements-tests.txt
          - name: Install Pydantic v1
            if: matrix.pydantic-version == 'pydantic-v1'
            run: uv pip install "pydantic>=1.10.0,<2.0.0"
          - name: Install Pydantic v2
            if: matrix.pydantic-version == 'pydantic-v2'
            run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
          - run: mkdir coverage
          - name: Test
            run: bash scripts/test.sh
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 12:27:19 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top