
- Create Todo model and schemas - Set up API endpoints for CRUD operations - Configure SQLAlchemy for database access - Set up Alembic for database migrations - Add Ruff for code linting - Update README with project documentation
24 lines
589 B
Python
24 lines
589 B
Python
"""
|
|
Todo model module.
|
|
"""
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import Boolean, Column, DateTime, Integer, String, Text
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class Todo(Base):
|
|
"""
|
|
Todo model.
|
|
"""
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(255), nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
completed = Column(Boolean, default=False)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(
|
|
DateTime,
|
|
default=datetime.utcnow,
|
|
onupdate=datetime.utcnow
|
|
) |