Automated Action 1d7eac0ac7 Add due date feature to Todo application
- Added due_date field to Todo model
- Updated schemas to include due_date field
- Created Alembic migration for the new field
- Added API endpoint to filter todos by due date range
- Updated README to document the new feature

🤖 Generated with BackendIM... (backend.im)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-13 05:14:03 +00:00

13 lines
576 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.db.base_class import Base
class Todo(Base):
id = Column(Integer, primary_key=True, index=True)
title = Column(String, index=True)
description = Column(String, nullable=True)
completed = Column(Boolean, default=False)
due_date = Column(DateTime(timezone=True), nullable=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())