19 lines
354 B
Python
19 lines
354 B
Python
"""Pydantic models for request/response schemas."""
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class ItemCreate(BaseModel):
|
|
name: str
|
|
|
|
|
|
class ItemResponse(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
name: str
|
|
created_at: Optional[datetime] = None
|