21 lines
397 B
Python
21 lines
397 B
Python
from typing import List, Optional, Dict, Any
|
|
from pydantic import BaseModel
|
|
|
|
class AttributeValue(BaseModel):
|
|
id: int
|
|
val: str
|
|
|
|
class Attribute(BaseModel):
|
|
id: int
|
|
name: str
|
|
vals: List[AttributeValue]
|
|
|
|
class Category(BaseModel):
|
|
id: int
|
|
name: str
|
|
image: Optional[str] = None
|
|
atributes: List[Attribute] = []
|
|
|
|
class Config:
|
|
from_attributes = True
|