Automated Action 355d2a84d5 Implement notes management platform with FastAPI and SQLite
- Set up project structure with FastAPI
- Create database models for notes
- Implement Alembic migrations
- Create API endpoints for note CRUD operations
- Implement note export functionality (markdown, txt, pdf)
- Add health endpoint
- Set up linting with Ruff
2025-06-04 08:13:43 +00:00

36 lines
694 B
Python

from datetime import datetime
from typing import Literal, Optional
from pydantic import BaseModel, Field
class NoteBase(BaseModel):
title: str = Field(..., min_length=1, max_length=255)
content: str = Field(..., min_length=1)
class NoteCreate(NoteBase):
pass
class NoteUpdate(BaseModel):
title: Optional[str] = Field(None, min_length=1, max_length=255)
content: Optional[str] = Field(None, min_length=1)
class NoteInDB(NoteBase):
id: int
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
class Note(NoteInDB):
pass
class NoteExport(BaseModel):
format: Literal["markdown", "txt", "pdf"] = "markdown"