Download behavior_backend/app/models/user.py from urjob/test: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/spaces/urjob/test/resolve/main/behavior_backend/app/models/user.py
- Command line
-
hf download hf://spaces/urjob/test/behavior_backend/app/models/user.py
-
curl -L -o user.py https://huggingface.co/spaces/urjob/test/resolve/main/behavior_backend/app/models/user.py
780 Bytes
| from pydantic import BaseModel, EmailStr, Field | |
| from typing import Optional | |
| from datetime import datetime | |
| from sqlalchemy.ext.asyncio import AsyncSession | |
| from sqlalchemy import select | |
| class UserBase(BaseModel): | |
| """Base model for user data.""" | |
| email: EmailStr | |
| first_name: str | |
| last_name: str | |
| class UserCreate(UserBase): | |
| """Model for creating a new user.""" | |
| password: str | |
| class User(UserBase): | |
| """Model for user response.""" | |
| id: str | |
| created_at: datetime | |
| is_active: bool | |
| class Config: | |
| from_attributes = True | |
| class UserLogin(BaseModel): | |
| email: EmailStr | |
| password: str | |
| class UserOut(BaseModel): | |
| id: str | |
| email: EmailStr | |
| first_name: str | |
| last_name: str | |
| class Config: | |
| from_attributes = True | |