Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message_box field to Student class #139

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions vulcan/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions vulcan/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
Lesson,
LuckyNumber,
Message,
MessageBox,
)
from .model import DateTime
from .model import DateTime, MessageBox


class VulcanData:
Expand Down
1 change: 0 additions & 1 deletion vulcan/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions vulcan/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vulcan/data/_messagebox.py → vulcan/model/_messagebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from related import IntegerField, StringField, immutable

from .._endpoints import DATA_MESSAGEBOX
from ..model import Serializable
from ._serializable import Serializable


@immutable
Expand Down
3 changes: 3 additions & 0 deletions vulcan/model/_student.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""
Expand All @@ -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
Expand Down
Loading