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:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
  • period_set (Reverse ForeignKey from Period) – All period set of this course (related name of course)

  • studentimport (Reverse OneToOneField from StudentImport) – The Student Import of this course (related name of course)

  • folders (Reverse ForeignKey from Folder) – All folders of this course (related name of course)

  • assignments (Reverse ForeignKey from Assignment) – All assignments of this course (related name of course)

  • file_actions (Reverse ManyToManyField from FileAction) – All file actions of this course (related name of courses)

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_teacher_str

Get a string of the last names of all teachers in a course

is_only_student_in_course

Check if a user is the only student in a course

is_student_in_course

Check if a student is registered in the course

Attributes

PERMISSIONS

SORT_BY

archived

Type: BooleanField

assignments

Type: Reverse ForeignKey from Assignment

created

Type: DateTimeField

file_actions

Type: Reverse ManyToManyField from FileAction

folders

Type: Reverse ForeignKey from Folder

id

Type: BigAutoField

name

Type: CharField

objects

period_set

Type: Reverse ForeignKey from Period

permission

Type: CharField

sort_assignments_by

Type: CharField

studentimport

Type: Reverse OneToOneField from StudentImport

students

Type: ManyToManyField to User

teacher

Type: ManyToManyField to User

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_teacher_str() str[source]

Get a string of the last names of all teachers in a course

is_only_student_in_course(user) bool[source]

Check if a user is the only student in a course

is_student_in_course(user) bool[source]

Check if a student is registered in the course