todoapp-kcnfku/app/db/base_class.py
Automated Action 5fbf8c4171 Create simple Todo app with FastAPI and SQLite
- Setup project structure with FastAPI
- Create Todo model and database schemas
- Implement CRUD operations for Todo items
- Create API endpoints for Todo operations
- Add health check endpoint
- Configure Alembic for database migrations
- Add detailed documentation in README.md
2025-05-27 16:58:01 +00:00

15 lines
315 B
Python

from typing import Any
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import DeclarativeBase
class Base(DeclarativeBase):
id: Any
__name__: str
# Generate __tablename__ automatically
@declared_attr
def __tablename__(cls) -> str:
return cls.__name__.lower()