Files
gallery/gallery/sketch/schedule/model.py

47 lines
874 B
Python

import datetime
from enum import StrEnum
from pydantic import BaseModel
class Model(BaseModel):
class Config:
use_enum_values = True
class ChannelId(StrEnum):
MATCH_TV = "matchtv"
MATCH_IGRA = "igra"
MATCH_ARENA = "arena"
MATCH_FUTBOL_1 = "futbol-1"
MATCH_FUTBOL_2 = "futbol-2"
MATCH_FUTBOL_3 = "futbol-3"
MATCH_STRANA = "strana"
MATCH_PLANETA = "planeta"
EUROSPORT = "eurosport"
EUROSPORT_2 = "eurosport-2"
START = "start"
TEST = "test"
def __str__(self) -> str:
return self.value
class Channel(Model):
id: ChannelId
name: str
class ScheduleValue(Model):
start: datetime.datetime
end: datetime.datetime
label: str
category: str | None = None
live: bool = False
class Schedule(Model):
channel: Channel
date: datetime.date
values: list[ScheduleValue]