
- Setup project structure with FastAPI app - Create SQLAlchemy models for categories, questions, quizzes, and results - Implement API endpoints for all CRUD operations - Set up Alembic migrations for database schema management - Add comprehensive documentation in README.md
18 lines
428 B
Python
18 lines
428 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
|
|
|
|
class CategoryBase(BaseModel):
|
|
name: str = Field(..., min_length=1, max_length=100, description="Name of the category")
|
|
description: Optional[str] = Field(None, description="Description of the category")
|
|
|
|
|
|
class CategoryCreate(CategoryBase):
|
|
pass
|
|
|
|
|
|
class CategoryResponse(CategoryBase):
|
|
id: int
|
|
|
|
class Config:
|
|
from_attributes = True |