
- Add FastAPI application with CORS support - Implement SQLite database with SQLAlchemy - Create Item model with CRUD operations - Setup Alembic for database migrations - Add comprehensive API endpoints for Items - Include health check endpoint - Update README with documentation
22 lines
457 B
Python
22 lines
457 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
class ItemBase(BaseModel):
|
|
name: str
|
|
description: Optional[str] = None
|
|
|
|
class ItemCreate(ItemBase):
|
|
pass
|
|
|
|
class ItemUpdate(BaseModel):
|
|
name: Optional[str] = None
|
|
description: Optional[str] = None
|
|
|
|
class Item(ItemBase):
|
|
id: int
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True |