simpletodoapp-j6n8zk/app/db/base_class.py
Automated Action 18f0e055cd Create simple todo app with FastAPI and SQLite
- Setup FastAPI project structure
- Create SQLAlchemy models and database connection
- Implement Alembic migrations
- Create CRUD operations for todos
- Add API endpoints for todos
- Add health endpoint
- Update README.md

generated with BackendIM... (backend.im)
2025-05-13 05:06:00 +00:00

13 lines
317 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()