Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 18 for EmailStr (0.44 seconds)

  1. docs_src/response_model/tutorial003_py310.py

    from typing import Any
    
    from fastapi import FastAPI
    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:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 431 bytes
    - Click Count (0)
  2. docs_src/extra_models/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserBase(BaseModel):
        username: str
        email: EmailStr
        full_name: str | None = None
    
    
    class UserIn(UserBase):
        password: str
    
    
    class UserOut(UserBase):
        pass
    
    
    class UserInDB(UserBase):
        hashed_password: str
    
    
    def fake_password_hasher(raw_password: str):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 798 bytes
    - Click Count (0)
  3. docs_src/extra_models/tutorial001_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
    
    
    class UserInDB(BaseModel):
        username: str
        hashed_password: str
        email: EmailStr
        full_name: str | None = None
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 905 bytes
    - Click Count (0)
  4. 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:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 317 bytes
    - Click Count (0)
  5. docs_src/response_model/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserIn(BaseModel):
        username: str
        password: str
        email: EmailStr
        full_name: str | None = None
    
    
    # Don't do this in production!
    @app.post("/user/")
    async def create_user(user: UserIn) -> UserIn:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 318 bytes
    - Click Count (0)
  6. fastapi/openapi/models.py

    try:
        import email_validator
    
        assert email_validator  # make autoflake ignore the unused import
        from pydantic import EmailStr
    except ImportError:  # pragma: no cover
    
        class EmailStr(str):  # type: ignore  # ty: ignore[unused-ignore-comment]
            @classmethod
            def __get_validators__(cls) -> Iterable[Callable[..., Any]]:
                yield cls.validate
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 14.2K bytes
    - Click Count (0)
  7. docs/en/docs/tutorial/response-model.md

    Here we are declaring a `UserIn` model, it will contain a plaintext password:
    
    {* ../../docs_src/response_model/tutorial002_py310.py hl[7,9] *}
    
    /// info
    
    To use `EmailStr`, first install [`email-validator`](https://github.com/JoshData/python-email-validator).
    
    Make sure you create a [virtual environment](../virtual-environments.md), activate it, and then install it, for example:
    
    ```console
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 15.5K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/tutorial/response-model.md

    ## 回傳與輸入相同的資料 { #return-the-same-input-data }
    
    這裡我們宣告一個 `UserIn` 模型,其中會包含明文密碼:
    
    {* ../../docs_src/response_model/tutorial002_py310.py hl[7,9] *}
    
    /// info | 說明
    
    要使用 `EmailStr`,請先安裝 [`email-validator`](https://github.com/JoshData/python-email-validator)。
    
    請先建立一個[虛擬環境](../virtual-environments.md)、啟用它,然後安裝,例如:
    
    ```console
    $ pip install email-validator
    ```
    
    或:
    
    ```console
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 14.5K bytes
    - Click Count (0)
  9. docs/pt/docs/tutorial/response-model.md

    Aqui estamos declarando um modelo `UserIn`, ele conterá uma senha em texto simples:
    
    {* ../../docs_src/response_model/tutorial002_py310.py hl[7,9] *}
    
    /// info | Informação
    
    Para usar `EmailStr`, primeiro instale [`email-validator`](https://github.com/JoshData/python-email-validator).
    
    Certifique-se de criar um [ambiente virtual](../virtual-environments.md), ative-o e então instale-o, por exemplo:
    
    ```console
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 16.7K bytes
    - Click Count (0)
  10. docs/tr/docs/tutorial/response-model.md

    Burada `UserIn` adında bir model declare ediyoruz; bu model plaintext bir password içerecek:
    
    {* ../../docs_src/response_model/tutorial002_py310.py hl[7,9] *}
    
    /// info | Bilgi
    
    `EmailStr` kullanmak için önce [`email-validator`](https://github.com/JoshData/python-email-validator) paketini kurun.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 17K bytes
    - Click Count (0)
Back to Top