AssignmentQuerySet

Qualified name: tin.apps.assignments.models.AssignmentQuerySet

class AssignmentQuerySet(model=None, query=None, using=None, hints=None)[source]

Bases: QuerySet

Methods

filter_editable

Filters assignments if they're editable by the user

filter_permissions

Filters based off of the permissions of the user and the course.

filter_submittable

Filters by assignments that can be submitted.

filter_visible

Filters assignments that are visible to a user

Attributes

filter_editable(user)[source]

Filters assignments if they’re editable by the user

filter_permissions(user, *perms: Literal['-', 'r', 'w'])[source]

Filters based off of the permissions of the user and the course.

An admin can always see everything. A teacher can only see courses they are the teachers for. Otherwise it filters it based off the course being archived and/or the permission of the course after archiving.

Parameters:
  • user – The user executing the query (request.user)

  • *perms – Every permission listed is or-ed together. Each value can be - (hidden), r (read-only), or w (read-write)

filter_submittable(user)[source]

Filters by assignments that can be submitted.

Warning

Do NOT use this if is_quiz is True. In that case, the check should be done manually.

filter_visible(user)[source]

Filters assignments that are visible to a user

Alias for calling filter_permissions with the permissions “r” and “w”