Course¶
Qualified name: tin.apps.courses.models.Course
- class Course(*args, **kwargs)[source]¶
Bases:
ModelA 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 (
ManyToManyFieldtoUser) – Teacher (related name:taught_courses)students (
ManyToManyFieldtoUser) – Students (related name:courses)
Reverse relationships:
- Parameters:
period_set (Reverse
ForeignKeyfromPeriod) – All period set of this course (related name ofcourse)studentimport (Reverse
OneToOneFieldfromStudentImport) – The Student Import of this course (related name ofcourse)folders (Reverse
ForeignKeyfromFolder) – All folders of this course (related name ofcourse)assignments (Reverse
ForeignKeyfromAssignment) – All assignments of this course (related name ofcourse)file_actions (Reverse
ManyToManyFieldfromFileAction) – All file actions of this course (related name ofcourses)
Methods
get_absolute_urlget_next_by_createdFinds next instance based on
created.get_permission_displayShows the label of the
permission.get_previous_by_createdFinds previous instance based on
created.get_sort_assignments_by_displayShows 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
PERMISSIONSSORT_BYarchivedType:
BooleanFieldassignmentsType: Reverse
ForeignKeyfromAssignmentcreatedType:
DateTimeFieldfile_actionsType: Reverse
ManyToManyFieldfromFileActionfoldersType: Reverse
ForeignKeyfromFolderidType:
BigAutoFieldnameType:
CharFieldobjectsperiod_setType: Reverse
ForeignKeyfromPeriodpermissionType:
CharFieldsort_assignments_byType:
CharFieldstudentimportType: Reverse
OneToOneFieldfromStudentImportstudentsType:
ManyToManyFieldtoUserteacherType:
ManyToManyFieldtoUser- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned