Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 24 of 24 for ItemCreate (0.16 sec)

  1. docs_src/sql_databases/sql_app/alt_main.py

            raise HTTPException(status_code=404, detail="User not found")
        return db_user
    
    
    @app.post("/users/{user_id}/items/", response_model=schemas.Item)
    def create_item_for_user(
        user_id: int, item: schemas.ItemCreate, db: Session = Depends(get_db)
    ):
        return crud.create_user_item(db=db, item=item, user_id=user_id)
    
    
    @app.get("/items/", response_model=List[schemas.Item])
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/sql-databases.md

        这些 Pydantic 模型或多或少地定义了一个“schema”(一个有效的数据形状)。
    
        因此,这将帮助我们在使用两者时避免混淆。
    
    ### 创建初始 Pydantic*模型*/模式
    
    创建一个`ItemBase`和`UserBase`Pydantic*模型*(或者我们说“schema”)以及在创建或读取数据时具有共同的属性。
    
    `ItemCreate`为 创建一个`UserCreate`继承自它们的所有属性(因此它们将具有相同的属性),以及创建所需的任何其他数据(属性)。
    
    因此在创建时也应当有一个`password`属性。
    
    但是为了安全起见,`password`不会出现在其他同类 Pydantic*模型*中,例如用户请求时不应该从 API 返回响应中包含它。
    
    === "Python 3.10+"
    
    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)
  3. docs/em/docs/tutorial/sql-databases.md

        👫 Pydantic 🏷 🔬 🌅 ⚖️ 🌘 "🔗" (☑ 📊 💠).
    
        👉 🔜 ℹ 👥 ❎ 😨 ⏪ ⚙️ 👯‍♂️.
    
    ### ✍ ▶️ Pydantic *🏷* / 🔗
    
    ✍ `ItemBase` & `UserBase` Pydantic *🏷* (⚖️ ➡️ 💬 "🔗") ✔️ ⚠ 🔢 ⏪ 🏗 ⚖️ 👂 📊.
    
    & ✍ `ItemCreate` & `UserCreate` 👈 😖 ⚪️➡️ 👫 (👫 🔜 ✔️ 🎏 🔢), ➕ 🙆 🌖 📊 (🔢) 💪 🏗.
    
    , 👩‍💻 🔜 ✔️ `password` 🕐❔ 🏗 ⚫️.
    
    ✋️ 💂‍♂, `password` 🏆 🚫 🎏 Pydantic *🏷*, 🖼, ⚫️ 🏆 🚫 📨 ⚪️➡️ 🛠️ 🕐❔ 👂 👩‍💻.
    
    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)
  4. docs/en/docs/tutorial/sql-databases.md

    ### Create initial Pydantic *models* / schemas
    
    Create an `ItemBase` and `UserBase` Pydantic *models* (or let's say "schemas") to have common attributes while creating or reading data.
    
    And create an `ItemCreate` and `UserCreate` that inherit from them (so they will have the same attributes), plus any additional data (attributes) needed for creation.
    
    So, the user will also have a `password` when creating it.
    
    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)
Back to top