Course¶
Qualified name: tin.apps.courses.models.Course
- class Course(*args, **kwargs)[source]¶
Bases:
Model
A TJHSST Course
e.g. Foundations of Computer Science
- Parameters:
id (BigAutoField) – Primary key: ID
name (CharField) – Name
created (DateTimeField) – Created
sort_assignments_by (CharField) – Sort assignments by
archived (BooleanField) – Archived
permission (CharField) – Permission
Relationship fields:
- Parameters:
teacher (
ManyToManyField
toUser
) – Teacher (related name:taught_courses
)students (
ManyToManyField
toUser
) – Students (related name:courses
)
Reverse relationships:
- Parameters:
period_set (Reverse
ForeignKey
fromPeriod
) – All period set of this course (related name ofcourse
)studentimport (Reverse
OneToOneField
fromStudentImport
) – The Student Import of this course (related name ofcourse
)folders (Reverse
ForeignKey
fromFolder
) – All folders of this course (related name ofcourse
)assignments (Reverse
ForeignKey
fromAssignment
) – All assignments of this course (related name ofcourse
)file_actions (Reverse
ManyToManyField
fromFileAction
) – All file actions of this course (related name ofcourses
)
Methods
get_absolute_url
get_next_by_created
Finds next instance based on
created
.get_permission_display
Shows the label of the
permission
.get_previous_by_created
Finds previous instance based on
created
.get_sort_assignments_by_display
Shows the label of the
sort_assignments_by
.Get a string of the last names of all teachers in a course
Check if a user is the only student in a course
Check if a student is registered in the course
Attributes
PERMISSIONS
SORT_BY
archived
Type:
BooleanField
assignments
Type: Reverse
ForeignKey
fromAssignment
created
Type:
DateTimeField
file_actions
Type: Reverse
ManyToManyField
fromFileAction
folders
Type: Reverse
ForeignKey
fromFolder
id
Type:
BigAutoField
name
Type:
CharField
objects
period_set
Type: Reverse
ForeignKey
fromPeriod
permission
Type:
CharField
sort_assignments_by
Type:
CharField
studentimport
Type: Reverse
OneToOneField
fromStudentImport
students
Type:
ManyToManyField
toUser
teacher
Type:
ManyToManyField
toUser
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned