2024-10-08 23:28:52 +04:00
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
class LaptopBase(BaseModel):
|
|
|
|
title: str
|
|
|
|
price: float
|
|
|
|
processor: str
|
|
|
|
ram: int
|
|
|
|
ssd: int
|
|
|
|
display: float
|
|
|
|
|
|
|
|
class LaptopCreate(LaptopBase):
|
|
|
|
price: float
|
|
|
|
|
|
|
|
class LaptopResponse(LaptopBase):
|
|
|
|
id: int
|
|
|
|
price: float
|
|
|
|
|
|
|
|
class Config:
|
2024-10-13 16:40:44 +04:00
|
|
|
from_attributes = True
|