21 lines
527 B
Python
21 lines
527 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
from uuid import UUID
|
|
|
|
class LaptopBrandBase(BaseModel):
|
|
name: str = Field(..., description="Laptop brand name")
|
|
|
|
class LaptopBrandCreate(LaptopBrandBase):
|
|
pass
|
|
|
|
class LaptopBrandUpdate(LaptopBrandBase):
|
|
name: Optional[str] = Field(None, description="Laptop brand name")
|
|
|
|
class LaptopBrandSchema(LaptopBrandBase):
|
|
id: UUID
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
orm_mode = True |