From 7e75c9f386ad6d9bdb0077b5765cc7ddb9c5afa1 Mon Sep 17 00:00:00 2001 From: Antoni Czaplicki <56671347+Antoni-Czaplicki@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:52:16 +0200 Subject: [PATCH] Add message_box field to Student class (#139) * Add message_box field to Student class * Undo version change --- vulcan/_api.py | 4 +--- vulcan/_data.py | 3 +-- vulcan/data/__init__.py | 1 - vulcan/model/__init__.py | 1 + vulcan/{data => model}/_messagebox.py | 2 +- vulcan/model/_student.py | 3 +++ 6 files changed, 7 insertions(+), 7 deletions(-) rename vulcan/{data => model}/_messagebox.py (95%) diff --git a/vulcan/_api.py b/vulcan/_api.py index 41c98f7..1fd29ca 100644 --- a/vulcan/_api.py +++ b/vulcan/_api.py @@ -103,9 +103,7 @@ async def _request( full_url = ( url if url.startswith("http") - else self._rest_url + url - if self._rest_url - else None + else self._rest_url + url if self._rest_url else None ) if not full_url: diff --git a/vulcan/_data.py b/vulcan/_data.py index 5ddf98c..fb8b404 100644 --- a/vulcan/_data.py +++ b/vulcan/_data.py @@ -13,9 +13,8 @@ Lesson, LuckyNumber, Message, - MessageBox, ) -from .model import DateTime +from .model import DateTime, MessageBox class VulcanData: diff --git a/vulcan/data/__init__.py b/vulcan/data/__init__.py index 368abf6..b9c1325 100644 --- a/vulcan/data/__init__.py +++ b/vulcan/data/__init__.py @@ -8,4 +8,3 @@ from ._lesson import ChangedLesson, Lesson, LessonChanges, LessonRoom from ._lucky_number import LuckyNumber from ._message import Address, Message -from ._messagebox import MessageBox diff --git a/vulcan/model/__init__.py b/vulcan/model/__init__.py index 8120ff8..43b4702 100644 --- a/vulcan/model/__init__.py +++ b/vulcan/model/__init__.py @@ -2,6 +2,7 @@ from ._attachment import Attachment from ._datetime import DateTime +from ._messagebox import MessageBox from ._period import Period from ._pupil import Gender, Pupil from ._school import School diff --git a/vulcan/data/_messagebox.py b/vulcan/model/_messagebox.py similarity index 95% rename from vulcan/data/_messagebox.py rename to vulcan/model/_messagebox.py index d0dd788..3f71fb4 100644 --- a/vulcan/data/_messagebox.py +++ b/vulcan/model/_messagebox.py @@ -4,7 +4,7 @@ from related import IntegerField, StringField, immutable from .._endpoints import DATA_MESSAGEBOX -from ..model import Serializable +from ._serializable import Serializable @immutable diff --git a/vulcan/model/_student.py b/vulcan/model/_student.py index 72a19b1..870b7bb 100644 --- a/vulcan/model/_student.py +++ b/vulcan/model/_student.py @@ -4,6 +4,7 @@ from related import ChildField, SequenceField, StringField, immutable from .._endpoints import STUDENT_LIST +from ._messagebox import MessageBox from ._period import Period from ._pupil import Pupil from ._school import School @@ -24,6 +25,7 @@ class Student(Serializable): (e.g. several school buildings) :var `~vulcan.model.School` ~.school: info about the school (a single building of the unit) + :var `~vulcan.model.MessageBox` ~.message_box: the student's message box :var List[`~vulcan.model.Period`] ~.periods: a list of the student's school year periods """ @@ -35,6 +37,7 @@ class Student(Serializable): pupil: Pupil = ChildField(Pupil, key="Pupil") unit: Unit = ChildField(Unit, key="Unit") school: School = ChildField(School, key="ConstituentUnit") + message_box: MessageBox = ChildField(MessageBox, key="MessageBox") periods: List[Period] = SequenceField(Period, key="Periods") @property