
- 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
14 lines
440 B
Python
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() |