Spaces:
Sleeping
Sleeping
Update utils/instructor.py
Browse files- utils/instructor.py +3 -3
utils/instructor.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from typing_extensions import Self, Optional
|
| 2 |
from pydantic import model_validator
|
| 3 |
from sqlmodel import Field, Relationship
|
| 4 |
|
|
@@ -12,13 +12,13 @@ class Instructor(Person, table=True):
|
|
| 12 |
Represents an Instructor, inheriting from Person, with an additional department field.
|
| 13 |
|
| 14 |
Attributes:
|
| 15 |
-
department (
|
| 16 |
|
| 17 |
Methods:
|
| 18 |
set_id() -> Self: An SQLmodel validator that automatically sets the instructor's ID with a "INS" prefix through handle_id method in the Person class.
|
| 19 |
"""
|
| 20 |
|
| 21 |
-
department:
|
| 22 |
|
| 23 |
course_id: Optional[str] = Field(
|
| 24 |
default=None, foreign_key="course.id")
|
|
|
|
| 1 |
+
from typing_extensions import Self, Optional
|
| 2 |
from pydantic import model_validator
|
| 3 |
from sqlmodel import Field, Relationship
|
| 4 |
|
|
|
|
| 12 |
Represents an Instructor, inheriting from Person, with an additional department field.
|
| 13 |
|
| 14 |
Attributes:
|
| 15 |
+
department (str): The instructor's department.
|
| 16 |
|
| 17 |
Methods:
|
| 18 |
set_id() -> Self: An SQLmodel validator that automatically sets the instructor's ID with a "INS" prefix through handle_id method in the Person class.
|
| 19 |
"""
|
| 20 |
|
| 21 |
+
department: str = Field(default=Department.COMPUTER_SCIENCE)
|
| 22 |
|
| 23 |
course_id: Optional[str] = Field(
|
| 24 |
default=None, foreign_key="course.id")
|