
- Set up project structure with FastAPI - Implement user authentication system with JWT tokens - Create database models for users, notes, and collections - Set up SQLAlchemy ORM and Alembic migrations - Implement CRUD operations for notes and collections - Add filtering and sorting capabilities for notes - Implement health check endpoint - Update project documentation
36 lines
592 B
Python
36 lines
592 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class NoteBase(BaseModel):
|
|
title: str
|
|
content: str
|
|
is_archived: bool = False
|
|
collection_id: int | None = None
|
|
|
|
|
|
class NoteCreate(NoteBase):
|
|
pass
|
|
|
|
|
|
class NoteUpdate(BaseModel):
|
|
title: str | None = None
|
|
content: str | None = None
|
|
is_archived: bool | None = None
|
|
collection_id: int | None = None
|
|
|
|
|
|
class NoteInDBBase(NoteBase):
|
|
id: int
|
|
owner_id: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class Note(NoteInDBBase):
|
|
pass
|