Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for Buterin (0.2 sec)

  1. docs_src/response_model/tutorial003_py310.py

    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: str | None = None
    
    
    class UserOut(BaseModel):
        username: str
        email: EmailStr
        full_name: str | None = None
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user: UserIn) -> Any:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 431 bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/response-model.md

    `BaseUser` has the base fields. Then `UserIn` inherits from `BaseUser` and adds the `password` field, so, it will include all the fields from both models.
    
    We annotate the function return type as `BaseUser`, but we are actually returning a `UserIn` instance.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/response-model.md

    但最重要的是:
    
    * 会将输出数据限制在该模型定义内。下面我们会看到这一点有多重要。
    
    !!! note "技术细节"
        响应模型在参数中被声明,而不是作为函数返回类型的注解,这是因为路径函数可能不会真正返回该响应模型,而是返回一个 `dict`、数据库对象或其他模型,然后再使用 `response_model` 来执行字段约束和序列化。
    
    ## 返回与输入相同的数据
    
    现在我们声明一个 `UserIn` 模型,它将包含一个明文密码属性。
    
    ```Python hl_lines="9  11"
    {!../../../docs_src/response_model/tutorial002.py!}
    ```
    
    我们正在使用此模型声明输入数据,并使用同一模型声明输出数据:
    
    ```Python hl_lines="17-18"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  4. docs/ja/docs/tutorial/response-model.md

    !!! note "技術詳細"
        レスポンスモデルは、関数の戻り値のアノテーションではなく、このパラメータで宣言されています。なぜなら、パス関数は実際にはそのレスポンスモデルを返すのではなく、`dict`やデータベースオブジェクト、あるいは他のモデルを返し、`response_model`を使用してフィールドの制限やシリアライズを行うからです。
    
    ## 同じ入力データの返却
    
    ここでは`UserIn`モデルを宣言しています。それには平文のパスワードが含まれています:
    
    ```Python hl_lines="9 11"
    {!../../../docs_src/response_model/tutorial002.py!}
    ```
    
    そして、このモデルを使用して入力を宣言し、同じモデルを使って出力を宣言しています:
    
    ```Python hl_lines="17 18"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  5. docs_src/response_model/tutorial002.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    # Don't do this in production!
    @app.post("/user/")
    async def create_user(user: UserIn) -> UserIn:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 350 bytes
    - Viewed (0)
  6. docs_src/response_model/tutorial003_01_py310.py

    app = FastAPI()
    
    
    class BaseUser(BaseModel):
        username: str
        email: EmailStr
        full_name: str | None = None
    
    
    class UserIn(BaseUser):
        password: str
    
    
    @app.post("/user/")
    async def create_user(user: UserIn) -> BaseUser:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 317 bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial003_01.py

    app = FastAPI()
    
    
    class BaseUser(BaseModel):
        username: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    class UserIn(BaseUser):
        password: str
    
    
    @app.post("/user/")
    async def create_user(user: UserIn) -> BaseUser:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 349 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_response_model/test_tutorial003.py

                                {"title": "Full Name", "type": "string"}
                            ),
                        },
                    },
                    "UserIn": {
                        "title": "UserIn",
                        "required": ["username", "password", "email"],
                        "type": "object",
                        "properties": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/response-model.md

    `BaseUser` verfügt über die Basis-Felder. Dann erbt `UserIn` von `BaseUser` und fügt das Feld `Passwort` hinzu, sodass dass es nun alle Felder beider Modelle hat.
    
    Wir annotieren den Funktionsrückgabetyp als `BaseUser`, geben aber tatsächlich eine `UserIn`-Instanz zurück.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:58 GMT 2024
    - 19.9K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/response-model.md

    ❔ 🔨 👉 👷 ❓ ➡️ ✅ 👈 👅. 👶
    
    ### 🆎 ✍ & 🏭
    
    🥇 ➡️ 👀 ❔ 👨‍🎨, ✍ & 🎏 🧰 🔜 👀 👉.
    
    `BaseUser` ✔️ 🧢 🏑. ⤴️ `UserIn` 😖 ⚪️➡️ `BaseUser` & 🚮 `password` 🏑,, ⚫️ 🔜 🔌 🌐 🏑 ⚪️➡️ 👯‍♂️ 🏷.
    
    👥 ✍ 🔢 📨 🆎 `BaseUser`, ✋️ 👥 🤙 🛬 `UserIn` 👐.
    
    👨‍🎨, ✍, & 🎏 🧰 🏆 🚫 😭 🔃 👉 ↩️, ⌨ ⚖, `UserIn` 🏿 `BaseUser`, ❔ ⛓ ⚫️ *☑* 🆎 🕐❔ ⚫️❔ ⌛ 🕳 👈 `BaseUser`.
    
    ### FastAPI 💽 🖥
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 16K bytes
    - Viewed (0)
Back to top