gabcares commited on
Commit
111a4bd
·
verified ·
1 Parent(s): 09fee05

Update utils/enrollment.py

Browse files

Use grade: str = Field(default=Grade.A_PLUS)

Files changed (1) hide show
  1. utils/enrollment.py +3 -3
utils/enrollment.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Optional, Union
2
  from utils.enums.grade import Grade
3
 
4
  from .student import Student
@@ -14,13 +14,13 @@ class Enrollment(SQLModel, table=True):
14
  id: (int): The enrollment ID
15
  student_id (str): The ID of the student who is enrolled in the course.
16
  course_id (str): The ID of the course in which the student is enrolled.
17
- grade (Union[str, Grade]): The grade assigned to the student for the course. Default if NO_GRADE with enum value of None if no grade has been assigned yet.
18
  """
19
 
20
  id: int = Field(primary_key=True)
21
  student_id: str = Field(foreign_key="student.id")
22
  course_id: str = Field(foreign_key="course.id")
23
- grade: Union[str, Grade] = Field(default=Grade.A_PLUS)
24
 
25
  course: "Course" = Relationship(
26
  back_populates="enrollments")
 
1
+ from typing import Optional
2
  from utils.enums.grade import Grade
3
 
4
  from .student import Student
 
14
  id: (int): The enrollment ID
15
  student_id (str): The ID of the student who is enrolled in the course.
16
  course_id (str): The ID of the course in which the student is enrolled.
17
+ grade (str): The grade assigned to the student for the course. Default if NO_GRADE with enum value of None if no grade has been assigned yet.
18
  """
19
 
20
  id: int = Field(primary_key=True)
21
  student_id: str = Field(foreign_key="student.id")
22
  course_id: str = Field(foreign_key="course.id")
23
+ grade: str = Field(default=Grade.A_PLUS)
24
 
25
  course: "Course" = Relationship(
26
  back_populates="enrollments")