20 lines
322 B
Python
20 lines
322 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:
|
|
from_attributes = True
|