Refactor Lesson model to use proper types for Change, Distribution, and Substitution
This commit is contained in:
parent
02e27165f3
commit
ceea7a5262
1 changed files with 27 additions and 4 deletions
|
@ -1,6 +1,30 @@
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
class LessonDate(BaseModel):
|
||||||
|
Timestamp: int
|
||||||
|
Date: str
|
||||||
|
DateDisplay: str
|
||||||
|
Time: str
|
||||||
|
|
||||||
|
class Change(BaseModel):
|
||||||
|
Id: int
|
||||||
|
Type: int
|
||||||
|
IsMerge: bool
|
||||||
|
Separation: bool
|
||||||
|
|
||||||
|
class Substitution(BaseModel):
|
||||||
|
Id: int
|
||||||
|
UnitId: int
|
||||||
|
ScheduleId: int
|
||||||
|
LessonDate: LessonDate
|
||||||
|
|
||||||
|
class Distribution(BaseModel):
|
||||||
|
Id: int
|
||||||
|
Key: str
|
||||||
|
Shortcut: str
|
||||||
|
Name: str
|
||||||
|
PartType: str
|
||||||
|
|
||||||
class LessonDate(BaseModel):
|
class LessonDate(BaseModel):
|
||||||
Timestamp: int
|
Timestamp: int
|
||||||
|
@ -43,7 +67,6 @@ class Clazz(BaseModel):
|
||||||
DisplayName: str
|
DisplayName: str
|
||||||
Symbol: str
|
Symbol: str
|
||||||
|
|
||||||
|
|
||||||
class Lesson(BaseModel):
|
class Lesson(BaseModel):
|
||||||
Id: int
|
Id: int
|
||||||
MergeChangeId: int | None
|
MergeChangeId: int | None
|
||||||
|
@ -55,12 +78,12 @@ class Lesson(BaseModel):
|
||||||
TeacherPrimary: Teacher
|
TeacherPrimary: Teacher
|
||||||
TeacherSecondary: Teacher | None
|
TeacherSecondary: Teacher | None
|
||||||
TeacherSecondary2: Teacher | None
|
TeacherSecondary2: Teacher | None
|
||||||
Change: str | None
|
Change: Change | None
|
||||||
Clazz: Clazz
|
Clazz: Clazz
|
||||||
Distribution: str | None
|
Distribution: Distribution | None
|
||||||
PupilAlias: str | None
|
PupilAlias: str | None
|
||||||
Visible: bool
|
Visible: bool
|
||||||
Substitution: str | None
|
Substitution: Substitution | None
|
||||||
Parent: str | None
|
Parent: str | None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Add table
Reference in a new issue