- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 269 for Dict (0.03 sec)
-
tests/test_dependency_contextmanager.py
pass class OtherDependencyError(Exception): pass async def asyncgen_state(state: Dict[str, str] = Depends(get_state)): state["/async"] = "asyncgen started" yield state["/async"] state["/async"] = "asyncgen completed" def generator_state(state: Dict[str, str] = Depends(get_state)): state["/sync"] = "generator started" yield state["/sync"]
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 17 04:13:50 UTC 2024 - 11.6K bytes - Viewed (0) -
docs/zh/docs/tutorial/extra-models.md
#### 用其它模型中的内容生成 Pydantic 模型 上例中 ,从 `user_in.dict()` 中得到了 `user_dict`,下面的代码: ```Python user_dict = user_in.dict() UserInDB(**user_dict) ``` 等效于: ```Python UserInDB(**user_in.dict()) ``` ……因为 `user_in.dict()` 是字典,在传递给 `UserInDB` 时,把 `**` 加在 `user_in.dict()` 前,可以让 Python 进行**解包**。 这样,就可以用其它 Pydantic 模型中的数据生成 Pydantic 模型。 #### 解包 `dict` 和更多关键字
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.6K bytes - Viewed (0) -
docs/em/docs/tutorial/extra-models.md
🖼 🔛 👥 🤚 `user_dict` ⚪️➡️ `user_in.dict()`, 👉 📟: ```Python user_dict = user_in.dict() UserInDB(**user_dict) ``` 🔜 🌓: ```Python UserInDB(**user_in.dict()) ``` ...↩️ `user_in.dict()` `dict`, & ⤴️ 👥 ⚒ 🐍 "🎁" ⚫️ 🚶♀️ ⚫️ `UserInDB` 🔠 ⏮️ `**`. , 👥 🤚 Pydantic 🏷 ⚪️➡️ 💽 ➕1️⃣ Pydantic 🏷. #### 🎁 `dict` & ➕ 🇨🇻
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.8K bytes - Viewed (0) -
docs/en/docs/tutorial/extra-models.md
So, if we create a Pydantic object `user_in` like: ```Python user_in = UserIn(username="john", password="secret", email="******@****.***") ``` and then we call: ```Python user_dict = user_in.dict() ``` we now have a `dict` with the data in the variable `user_dict` (it's a `dict` instead of a Pydantic model object). And if we call: ```Python
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.7K bytes - Viewed (0) -
tests/test_router_events.py
@asynccontextmanager async def lifespan(app: FastAPI) -> AsyncGenerator[Dict[str, bool], None]: state.app_startup = True yield {"app": True} state.app_shutdown = True @asynccontextmanager async def router_lifespan(app: FastAPI) -> AsyncGenerator[Dict[str, bool], None]: state.router_startup = True yield {"router": True}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 24 19:09:52 UTC 2024 - 7.3K bytes - Viewed (0) -
fastapi/params.py
"although still supported. Use examples instead." ), ] = _Unset, openapi_examples: Optional[Dict[str, Example]] = None, deprecated: Union[deprecated, str, bool, None] = None, include_in_schema: bool = True, json_schema_extra: Union[Dict[str, Any], None] = None, **extra: Any, ): if example is not _Unset: warnings.warn(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Sep 06 18:06:20 UTC 2024 - 27.5K bytes - Viewed (0) -
fastapi/openapi/utils.py
if license_info: info["license"] = license_info output: Dict[str, Any] = {"openapi": openapi_version, "info": info} if servers: output["servers"] = servers components: Dict[str, Dict[str, Any]] = {} paths: Dict[str, Dict[str, Any]] = {} webhook_paths: Dict[str, Dict[str, Any]] = {} operation_ids: Set[str] = set()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 22.6K bytes - Viewed (0) -
docs/de/docs/tutorial/extra-models.md
Pydantic-Modelle haben eine `.dict()`-Methode, die ein `dict` mit den Daten des Modells zurückgibt. Wenn wir also ein Pydantic-Objekt `user_in` erstellen, etwa so: ```Python user_in = UserIn(username="john", password="secret", email="******@****.***") ``` und wir rufen seine `.dict()`-Methode auf: ```Python user_dict = user_in.dict() ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.7K bytes - Viewed (0) -
docs/ru/docs/tutorial/extra-models.md
#### Pydantic-модель из содержимого другой модели Как в примере выше мы получили `user_dict` из `user_in.dict()`, этот код: ```Python user_dict = user_in.dict() UserInDB(**user_dict) ``` будет равнозначен такому: ```Python UserInDB(**user_in.dict()) ``` ...потому что `user_in.dict()` - это `dict`, и затем мы указываем, чтобы Python его "распаковал", когда передаём его в `UserInDB` и ставим перед ним `**`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.5K bytes - Viewed (0) -
docs/pt/docs/tutorial/extra-models.md
Como no exemplo acima, obtivemos o `user_dict` a partir do `user_in.dict()`, este código: ```Python user_dict = user_in.dict() UserInDB(**user_dict) ``` seria equivalente a: ```Python UserInDB(**user_in.dict()) ``` ...porque `user_in.dict()` é um `dict`, e depois fazemos o Python "desembrulhá-lo" passando-o para UserInDB precedido por `**`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.8K bytes - Viewed (0)