todoappbackend-8j4keo/app/db/base_class.py
Automated Action 2f75e43b7f Implement Todo API application with FastAPI and SQLite
- Created project structure with FastAPI setup
- Added SQLite database connection with SQLAlchemy ORM
- Implemented Todo model and schemas
- Added CRUD operations for Todo items
- Created API endpoints for Todo management
- Added health check endpoint
- Configured Alembic for database migrations
- Updated project documentation in README.md
2025-05-24 22:41:36 +00:00

14 lines
292 B
Python

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