-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from datetime import datetime | ||
|
||
from sqlalchemy.orm import Mapped, mapped_column | ||
|
||
from lms.db import Base | ||
from lms.models._mixins import CreatedUpdatedMixin | ||
|
||
|
||
class LMSTerm(CreatedUpdatedMixin, Base): | ||
__tablename__ = "lms_term" | ||
|
||
id: Mapped[int] = mapped_column(autoincrement=True, primary_key=True) | ||
|
||
tool_consumer_instance_guid: Mapped[str | None] = mapped_column(index=True) | ||
|
||
name: Mapped[str | None] = mapped_column() | ||
|
||
starts_at: Mapped[datetime | None] = mapped_column() | ||
"""The start date of the term.""" | ||
|
||
ends_at: Mapped[datetime | None] = mapped_column() | ||
"""The end date of the term.""" | ||
|
||
key: Mapped[str] = mapped_column(index=True, unique=True) | ||
"""Not all installs will send us an ID so we'll mantaint an internal key to be able to idneitfy each term and avoid duplicates.""" | ||
|
||
lms_id: Mapped[str | None] = mapped_column(index=True) | ||
"""ID of this term on the LMS.""" |