- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for owner_ids (0.2 sec)
-
docs/en/docs/release-notes.md
For example, if you have an app like this: ```Python from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str price: Optional[float] = None owner_ids: Optional[List[int]] = None app = FastAPI() @app.get("/items/invalidnone", response_model=Item) def get_invalid_none(): return None ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Nov 01 11:25:57 UTC 2024 - 460.3K bytes - Viewed (0) -
docs/em/docs/tutorial/sql-databases.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 25K bytes - Viewed (0) -
docs/zh/docs/tutorial/sql-databases.md
这里不是将每个关键字参数传递给Item并从Pydantic模型中读取每个参数,而是先生成一个字典,其中包含Pydantic模型的数据: `item.dict()` 然后我们将dict的键值对 作为关键字参数传递给 SQLAlchemy `Item`: `Item(**item.dict())` 然后我们传递 Pydantic模型未提供的额外关键字参数`owner_id`: `Item(**item.dict(), owner_id=user_id)` /// ## 主**FastAPI**应用程序 现在在`sql_app/main.py`文件中 让我们集成和使用我们之前创建的所有其他部分。 ### 创建数据库表 以非常简单的方式创建数据库表: //// tab | Python 3.9+
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 27.1K bytes - Viewed (0)