ruz-bot/helpers/models.py
Administrator b7ef588b34 initial
2022-10-21 13:43:59 +03:00

28 lines
467 B
Python

from dataclasses import dataclass
from typing import Optional
import marshmallow_dataclass
from marshmallow import EXCLUDE
@dataclass
class User:
chat_id: int
name: Optional[str] = None
group: Optional[str] = None
hse_id: Optional[int] = None
state: str = "new"
notify_minutes: Optional[int] = 10
class Meta:
unknown = EXCLUDE
@dataclass
class Lesson:
hse_id: int
UserSchema = marshmallow_dataclass.class_schema(User)