Skip to content

Commit

Permalink
Model changes for assignment.course_id
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospri committed Aug 6, 2024
1 parent a2a1bb4 commit 0b8e4a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lms/models/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lms.db import Base
from lms.models._mixins import CreatedUpdatedMixin
from lms.models.grouping import Grouping
from lms.models.grouping import Course, Grouping


class Assignment(CreatedUpdatedMixin, Base):
Expand Down Expand Up @@ -72,10 +72,10 @@ class Assignment(CreatedUpdatedMixin, Base):
title: Mapped[str | None] = mapped_column(sa.Unicode, index=True)
"""The resource link title from LTI params."""

description = sa.Column(sa.Unicode, nullable=True)
description: Mapped[str | None] = mapped_column(sa.Unicode)
"""The resource link description from LTI params."""

deep_linking_uuid: Mapped[str | None] = mapped_column(sa.Unicode, nullable=True)
deep_linking_uuid: Mapped[str | None] = mapped_column(sa.Unicode)
"""UUID that identifies the deep linking that created this assignment."""

groupings: DynamicMapped[Grouping] = sa.orm.relationship(
Expand All @@ -86,6 +86,8 @@ class Assignment(CreatedUpdatedMixin, Base):
"AssignmentMembership", lazy="dynamic", viewonly=True
)

course_id: Mapped[int | None] = mapped_column(sa.ForeignKey(Course.id))

@property
def course(self):
"""Course this assignment belongs to."""
Expand Down

0 comments on commit 0b8e4a3

Please sign in to comment.