Automated Action fd0d96616b Initial setup of FastAPI Todo Application
- Set up project structure
- Create FastAPI app with SQLite database
- Implement Todo API with CRUD operations
- Set up Alembic for database migrations
- Add health endpoint
- Create README with documentation
2025-05-27 10:47:50 +00:00

37 lines
687 B
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel
# Shared properties
class TodoBase(BaseModel):
title: str
description: Optional[str] = None
completed: bool = False
# Properties to receive on todo creation
class TodoCreate(TodoBase):
pass
# Properties to receive on todo update
class TodoUpdate(TodoBase):
title: Optional[str] = None
completed: Optional[bool] = None
# Properties shared by models stored in DB
class TodoInDBBase(TodoBase):
id: int
created_at: datetime
updated_at: datetime
class Config:
orm_mode = True
# Properties to return to client
class Todo(TodoInDBBase):
pass