Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for PlaneItem (1.54 sec)

  1. docs_src/extra_models/tutorial003.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class BaseItem(BaseModel):
        description: str
        type: str
    
    
    class CarItem(BaseItem):
        type: str = "car"
    
    
    class PlaneItem(BaseItem):
        type: str = "plane"
        size: int
    
    
    items = {
        "item1": {"description": "All my friends drive a low rider", "type": "car"},
        "item2": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 644 bytes
    - Viewed (1)
  2. tests/test_tutorial/test_extra_models/test_tutorial003_py310.py

                            }
                        ],
                    }
                }
            },
            "components": {
                "schemas": {
                    "PlaneItem": {
                        "title": "PlaneItem",
                        "required": IsOneOf(
                            ["description", "type", "size"],
                            # TODO: remove when deprecating Pydantic v1
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.3K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/extra-models.md

    === "Python 3.10+"
    
        ```Python hl_lines="1  14-15  18-20  33"
        {!> ../../../docs_src/extra_models/tutorial003_py310.py!}
        ```
    
    === "Python 3.8+"
    
    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)
  4. docs/pt/docs/tutorial/extra-models.md

    === "Python 3.8 and above"
    
        ```Python hl_lines="1  14-15  18-20  33"
        {!> ../../../docs_src/extra_models/tutorial003.py!}
        ```
    
    === "Python 3.10 and above"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/extra-models.md

    ### `Union` ๐Ÿ 3๏ธโƒฃ.1๏ธโƒฃ0๏ธโƒฃ
    
    ๐Ÿ‘‰ ๐Ÿ–ผ ๐Ÿ‘ฅ ๐Ÿšถโ€โ™€๏ธ `Union[PlaneItem, CarItem]` ๐Ÿ’ฒ โŒ `response_model`.
    
    โ†ฉ๏ธ ๐Ÿ‘ฅ ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ **๐Ÿ’ฒ โŒ** โ†ฉ๏ธ ๐Ÿšฎ โšซ๏ธ **๐Ÿ†Ž โœ**, ๐Ÿ‘ฅ โœ”๏ธ โš™๏ธ `Union` ๐Ÿ 3๏ธโƒฃ.1๏ธโƒฃ0๏ธโƒฃ.
    
    ๐Ÿšฅ โšซ๏ธ ๐Ÿ†Ž โœ ๐Ÿ‘ฅ ๐Ÿ’ช โœ”๏ธ โš™๏ธ โธ โธ,:
    
    ```Python
    some_variable: PlaneItem | CarItem
    ```
    
    โœ‹๏ธ ๐Ÿšฅ ๐Ÿ‘ฅ ๐Ÿšฎ ๐Ÿ‘ˆ `response_model=PlaneItem | CarItem` ๐Ÿ‘ฅ ๐Ÿ”œ ๐Ÿคš โŒ, โ†ฉ๏ธ ๐Ÿ ๐Ÿ”œ ๐Ÿ”„ ๐ŸŽญ **โŒ ๐Ÿ› ๏ธ** ๐Ÿ–– `PlaneItem` & `CarItem` โ†ฉ๏ธ ๐Ÿ”ฌ ๐Ÿ‘ˆ ๐Ÿ†Ž โœ.
    
    ## ๐Ÿ“‡ ๐Ÿท
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  6. docs_src/extra_models/tutorial003_py310.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class BaseItem(BaseModel):
        description: str
        type: str
    
    
    class CarItem(BaseItem):
        type: str = "car"
    
    
    class PlaneItem(BaseItem):
        type: str = "plane"
        size: int
    
    
    items = {
        "item1": {"description": "All my friends drive a low rider", "type": "car"},
        "item2": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 644 bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/extra-models.md

    === "Python 3.10+"
    
        ```Python hl_lines="1  14-15  18-20  33"
        {!> ../../../docs_src/extra_models/tutorial003_py310.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_extra_models/test_tutorial003.py

                            }
                        ],
                    }
                }
            },
            "components": {
                "schemas": {
                    "PlaneItem": {
                        "title": "PlaneItem",
                        "required": IsOneOf(
                            ["description", "type", "size"],
                            # TODO: remove when deprecating Pydantic v1
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/extra-models.md

    !!! note "็ฌ”่ฎฐ"
    
        ๅฎšไน‰ <a href="https://docs.pydantic.dev/latest/concepts/types/#unions" class="external-link" target="_blank">`Union`</a> ็ฑปๅž‹ๆ—ถ๏ผŒ่ฆๆŠŠ่ฏฆ็ป†็š„็ฑปๅž‹ๅ†™ๅœจๅ‰้ข๏ผŒ็„ถๅŽๆ˜ฏไธๅคช่ฏฆ็ป†็š„็ฑปๅž‹ใ€‚ไธ‹ไพ‹ไธญ๏ผŒๆ›ด่ฏฆ็ป†็š„ `PlaneItem` ไฝไบŽ `Union[PlaneItem๏ผŒCarItem]` ไธญ็š„ `CarItem` ไน‹ๅ‰ใ€‚
    
    === "Python 3.10+"
    
        ```Python hl_lines="1  14-15  18-20  33"
        {!> ../../../docs_src/extra_models/tutorial003_py310.py!}
        ```
    
    === "Python 3.8+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 01:15:53 GMT 2024
    - 6.7K bytes
    - Viewed (0)
Back to top