20 lines
314 B
Python
20 lines
314 B
Python
|
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:
|
||
|
orm_mode = True
|