- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for date (0.49 sec)
-
docs/zh/docs/tutorial/sql-databases.md
这是设置配置值,而不是声明类型。 Pydantic`orm_mode`将告诉 Pydantic*模型*读取数据,即它不是一个`dict`,而是一个 ORM 模型(或任何其他具有属性的任意对象)。 这样,而不是仅仅试图从`dict`上 `id` 中获取值,如下所示: ```Python id = data["id"] ``` 尝试从属性中获取它,如: ```Python id = data.id ``` 有了这个,Pydantic*模型*与 ORM 兼容,您只需在*路径操作*`response_model`的参数中声明它即可。 您将能够返回一个数据库模型,它将从中读取数据。 #### ORM 模式的技术细节 SQLAlchemy 和许多其他默认情况下是“延迟加载”。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 27K bytes - Viewed (0) -
docs/em/docs/tutorial/sql-databases.md
Pydantic `orm_mode` 🔜 💬 Pydantic *🏷* ✍ 💽 🚥 ⚫️ 🚫 `dict`, ✋️ 🐜 🏷 (⚖️ 🙆 🎏 ❌ 🎚 ⏮️ 🔢). 👉 🌌, ↩️ 🕴 🔄 🤚 `id` 💲 ⚪️➡️ `dict`,: ```Python id = data["id"] ``` ⚫️ 🔜 🔄 🤚 ⚫️ ⚪️➡️ 🔢,: ```Python id = data.id ``` & ⏮️ 👉, Pydantic *🏷* 🔗 ⏮️ 🐜, & 👆 💪 📣 ⚫️ `response_model` ❌ 👆 *➡ 🛠️*. 👆 🔜 💪 📨 💽 🏷 & ⚫️ 🔜 ✍ 💽 ⚪️➡️ ⚫️. #### 📡 ℹ 🔃 🐜 📳
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 25.2K bytes - Viewed (1) -
docs/en/docs/tutorial/sql-databases.md
### Create data Now create utility functions to create data. The steps are: * Create a SQLAlchemy model *instance* with your data. * `add` that instance object to your database session. * `commit` the changes to the database (so that they are saved). * `refresh` your instance (so that it contains any new data from the database, like the generated ID).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 29.6K bytes - Viewed (0)