
- Added filtering and pagination for todo listings - Fixed Alembic migration setup - Enhanced CRUD operations - Updated documentation with comprehensive README - Linted code with Ruff
16 lines
495 B
Python
16 lines
495 B
Python
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base import Base
|
|
|
|
|
|
class Todo(Base):
|
|
__tablename__ = "todos"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String, index=True)
|
|
description = Column(Text, nullable=True)
|
|
is_completed = Column(Boolean, default=False)
|
|
owner_id = Column(Integer, ForeignKey("users.id"))
|
|
|
|
owner = relationship("User", back_populates="todos") |