Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for BaseUser (0.18 sec)

  1. docs_src/response_model/tutorial003_01_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    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)
  2. docs_src/response_model/tutorial003_01.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    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)
  3. tests/test_tutorial/test_response_model/test_tutorial003_01.py

                                },
                            },
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "BaseUser": {
                        "title": "BaseUser",
                        "required": IsOneOf(
                            ["username", "email", "full_name"],
                            # TODO: remove when deprecating Pydantic v1
    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)
  4. tests/test_tutorial/test_response_model/test_tutorial003_01_py310.py

                                },
                            },
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "BaseUser": {
                        "title": "BaseUser",
                        "required": IsOneOf(
                            ["username", "email", "full_name"],
                            # TODO: remove when deprecating Pydantic v1
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  5. 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)
  6. docs/ru/docs/tutorial/response-model.md

    У модели `BaseUser` есть некоторые поля. Затем `UserIn` наследуется от `BaseUser` и добавляет новое поле `password`. Таким образом модель будет включать в себя все поля из первой модели (родителя), а также свои собственные.
    
    Мы аннотируем возвращаемый тип функции как `BaseUser`, но фактически мы будем возвращать объект типа `UserIn`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 30.5K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. tests/test_response_model_as_return_annotation.py

    from fastapi.responses import JSONResponse, Response
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    
    class BaseUser(BaseModel):
        name: str
    
    
    class User(BaseUser):
        surname: str
    
    
    class DBUser(User):
        password_hash: str
    
    
    class Item(BaseModel):
        name: str
        price: float
    
    
    app = FastAPI()
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Aug 14 09:49:57 GMT 2023
    - 47.7K bytes
    - Viewed (0)
Back to top