- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 13 for PlaneItem (0.24 seconds)
-
docs/en/docs/tutorial/extra-models.md
/// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### `Union` in Python 3.10 { #union-in-python-3-10 } In this example we pass `Union[PlaneItem, CarItem]` as the value of the argument `response_model`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 6.7K bytes - Click Count (0) -
docs_src/extra_models/tutorial003_py310.py
from fastapi import FastAPI 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": {
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 612 bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/extra-models.md
在定義 [`Union`](https://docs.pydantic.dev/latest/concepts/types/#unions) 時,請先放置「更具體」的型別,再放「較不具體」的型別。以下範例中,較具體的 `PlaneItem` 置於 `CarItem` 之前:`Union[PlaneItem, CarItem]`。 /// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### Python 3.10 中的 `Union` { #union-in-python-3-10 } 此範例中,我們將 `Union[PlaneItem, CarItem]` 作為引數 `response_model` 的值。 由於這裡是把它當作引數的「值」傳入,而非用於型別註記,因此即使在 Python 3.10 也必須使用 `Union`。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 6.3K bytes - Click Count (0) -
docs/es/docs/tutorial/extra-models.md
/// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### `Union` en Python 3.10 { #union-in-python-3-10 } En este ejemplo pasamos `Union[PlaneItem, CarItem]` como el valor del argumento `response_model`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:15:55 GMT 2026 - 7.2K bytes - Click Count (0) -
docs/uk/docs/tutorial/extra-models.md
/// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### `Union` у Python 3.10 { #union-in-python-3-10 } У цьому прикладі ми передаємо `Union[PlaneItem, CarItem]` як значення аргументу `response_model`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 9.4K bytes - Click Count (0) -
docs/fr/docs/tutorial/extra-models.md
/// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### `Union` en Python 3.10 { #union-in-python-3-10 } Dans cet exemple, nous passons `Union[PlaneItem, CarItem]` comme valeur de l'argument `response_model`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:37:13 GMT 2026 - 7.6K bytes - Click Count (0) -
docs/zh/docs/tutorial/extra-models.md
定义 [`Union`](https://docs.pydantic.dev/latest/concepts/types/#unions) 类型时,要把更具体的类型写在前面,然后是不太具体的类型。下例中,更具体的 `PlaneItem` 位于 `Union[PlaneItem, CarItem]` 中的 `CarItem` 之前。 /// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### Python 3.10 中的 `Union` { #union-in-python-3-10 } 在这个示例中,我们把 `Union[PlaneItem, CarItem]` 作为参数 `response_model` 的值传入。 因为这是作为“参数的值”而不是放在“类型注解”中,所以即使在 Python 3.10 也必须使用 `Union`。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 6.5K bytes - Click Count (0) -
docs/tr/docs/tutorial/extra-models.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 07:53:17 GMT 2026 - 7.4K bytes - Click Count (0) -
docs/ru/docs/tutorial/extra-models.md
/// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### `Union` в Python 3.10 { #union-in-python-3-10 } В этом примере мы передаём `Union[PlaneItem, CarItem]` в качестве значения аргумента `response_model`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 10.7K bytes - Click Count (0) -
docs/pt/docs/tutorial/extra-models.md
/// {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} ### `Union` no Python 3.10 { #union-in-python-3-10 } Neste exemplo, passamos `Union[PlaneItem, CarItem]` como o valor do argumento `response_model`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:20:43 GMT 2026 - 7.1K bytes - Click Count (0)