Spaces:
Running
Running
Claude Code - Backend Implementation Specialist
Claude Sonnet 4.5
Add complete AI Todo Chatbot backend application
b93a6a5 Download src/models/user.py from Abdul18/AI-Todo_Chatbot: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/Abdul18/AI-Todo_Chatbot/resolve/main/src/models/user.py
- Command line
-
hf download hf://spaces/Abdul18/AI-Todo_Chatbot/src/models/user.py
-
curl -L -o user.py https://huggingface.co/spaces/Abdul18/AI-Todo_Chatbot/resolve/main/src/models/user.py
1.09 kB
| from sqlmodel import SQLModel, Field, Relationship | |
| from datetime import datetime | |
| from typing import Optional, List, TYPE_CHECKING | |
| if TYPE_CHECKING: | |
| from src.models.conversation import Conversation | |
| class User(SQLModel, table=True): | |
| """User model representing an authenticated user of the application.""" | |
| __tablename__ = "users" | |
| id: Optional[int] = Field(default=None, primary_key=True) | |
| email: str = Field(unique=True, index=True, max_length=255) | |
| hashed_password: str = Field(max_length=255) | |
| created_at: datetime = Field(default_factory=datetime.utcnow) | |
| updated_at: datetime = Field(default_factory=datetime.utcnow) | |
| # Relationships | |
| tasks: List["Task"] = Relationship(back_populates="user") | |
| conversations: List["Conversation"] = Relationship(back_populates="user") | |
| class Config: | |
| json_schema_extra = { | |
| "example": { | |
| "id": 1, | |
| "email": "user@example.com", | |
| "created_at": "2026-02-05T10:00:00Z", | |
| "updated_at": "2026-02-05T10:00:00Z" | |
| } | |
| } | |