taskmanagerapi-i737xp/app/db/base_class.py
Automated Action d1c05cbd6e Implement Task Manager API with FastAPI and SQLite
- Set up project structure and dependencies
- Create database models for tasks and users with SQLAlchemy
- Configure Alembic for database migrations
- Implement authentication system with JWT tokens
- Create CRUD API endpoints for tasks and users
- Add health check endpoint
- Update README with documentation
2025-06-12 18:14:56 +00:00

14 lines
440 B
Python

from datetime import datetime
from sqlalchemy import Column, DateTime, Integer
from sqlalchemy.ext.declarative import declared_attr
class Base:
id = Column(Integer, primary_key=True, index=True)
created_at = Column(DateTime, default=datetime.utcnow)
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
@declared_attr
def __tablename__(cls) -> str:
return cls.__name__.lower()