Piotr Domański
e2af49046c
All checks were successful
Python lint and test / linttest (push) Successful in 5m30s
32 lines
488 B
Python
32 lines
488 B
Python
from typing import List
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from .preset_entry import PresetEntry
|
|
|
|
|
|
class Preset(BaseModel):
|
|
"""Preset."""
|
|
|
|
id: int
|
|
name: str
|
|
calories: float
|
|
protein: float
|
|
carb: float
|
|
fat: float
|
|
fiber: float
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class PresetDetails(Preset):
|
|
"""PresetDetails."""
|
|
|
|
entries: List[PresetEntry]
|
|
|
|
|
|
class ListPresetsPayload(BaseModel):
|
|
"""ListPresetsPayload."""
|
|
|
|
presets: List[Preset]
|