31 lines
565 B
Python
31 lines
565 B
Python
import datetime
|
|
from dataclasses import dataclass
|
|
from typing import Optional
|
|
|
|
import marshmallow_dataclass
|
|
from marshmallow import EXCLUDE
|
|
|
|
|
|
@dataclass
|
|
class User:
|
|
chat_id: int
|
|
next_notify_time: datetime.datetime
|
|
notify_daily: Optional[str] = "09:00"
|
|
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)
|