Spaces:
Sleeping
Sleeping
Download schemas/user.py from Abdullahcoder54/Todo_App: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/spaces/Abdullahcoder54/Todo_App/resolve/main/schemas/user.py
- Command line
-
hf download hf://spaces/Abdullahcoder54/Todo_App/schemas/user.py
-
curl -L -o user.py https://huggingface.co/spaces/Abdullahcoder54/Todo_App/resolve/main/schemas/user.py
513 Bytes
| from pydantic import BaseModel | |
| from typing import Optional | |
| from datetime import datetime | |
| class UserBase(BaseModel): | |
| email: str | |
| name: str | |
| class UserCreate(UserBase): | |
| """Schema for creating a new user.""" | |
| pass | |
| class UserRead(UserBase): | |
| """Schema for reading user data.""" | |
| id: int | |
| created_at: datetime | |
| class Config: | |
| from_attributes = True | |
| class UserUpdate(BaseModel): | |
| """Schema for updating user data.""" | |
| email: Optional[str] = None | |
| name: Optional[str] = None |