fooder-api/fooder/model/preset.py
Piotr Domański e2af49046c
All checks were successful
Python lint and test / linttest (push) Successful in 5m30s
[isort] ran with black profile
2024-08-04 16:17:16 +02:00

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]