Period¶
Qualified name: tin.apps.courses.models.Period
- class Period(*args, **kwargs)[source]¶
Bases:
Model
A Period, or a Block
e.g. Period 7
- Parameters:
id (BigAutoField) – Primary key: ID
name (CharField) – Name
created (DateTimeField) – Created
Relationship fields:
- Parameters:
course (
ForeignKey
toCourse
) – Course (related name:period_set
)teacher (
ForeignKey
toUser
) – Teacher (related name:taught_periods
)students (
ManyToManyField
toUser
) – Students (related name:periods
)
Reverse relationships:
- Parameters:
moss_results (Reverse
ForeignKey
fromMossResult
) – All moss results of this period (related name ofperiod
)
Methods
get_absolute_url
get_next_by_created
Finds next instance based on
created
.get_previous_by_created
Finds previous instance based on
created
.Attributes
course
Type:
ForeignKey
toCourse
course_id
Internal field, use
course
instead.created
Type:
DateTimeField
id
Type:
BigAutoField
moss_results
Type: Reverse
ForeignKey
fromMossResult
name
Type:
CharField
objects
students
Type:
ManyToManyField
toUser
teacher
Type:
ForeignKey
toUser
teacher_id
Internal field, use
teacher
instead.- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned