mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
16 lines
302 B
Python
16 lines
302 B
Python
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class CategoryBase(BaseModel):
|
|
name: str
|
|
description: Optional[str] = None
|
|
|
|
|
|
class CategoryCreate(CategoryBase):
|
|
pass
|
|
|
|
|
|
class CategoryRead(CategoryBase):
|
|
id: int
|
|
model_config = ConfigDict(from_attributes=True) |