User

Qualified name: tin.apps.users.models.User

class User(*args, **kwargs)[source]

Bases: AbstractBaseUser, PermissionsMixin

A Tin user

Parameters:

Relationship fields:

Parameters:
  • groups (ManyToManyField to Group) – Groups. The groups this user belongs to. A user will get all permissions granted to each of their groups. (related name: user_set)

  • user_permissions (ManyToManyField to Permission) – User permissions. Specific permissions for this user. (related name: user_set)

Reverse relationships:

Parameters:
  • logentry (Reverse ForeignKey from LogEntry) – All log entries of this user (related name of user)

  • social_auth (Reverse ForeignKey from UserSocialAuth) – All social auth of this user (related name of user)

  • taught_courses (Reverse ManyToManyField from Course) – All taught courses of this user (related name of teacher)

  • courses (Reverse ManyToManyField from Course) – All courses of this user (related name of students)

  • taught_periods (Reverse ForeignKey from Period) – All taught periods of this user (related name of teacher)

  • periods (Reverse ManyToManyField from Period) – All periods of this user (related name of students)

  • cooldown_periods (Reverse ForeignKey from CooldownPeriod) – All cooldown periods of this user (related name of student)

  • log_messages (Reverse ForeignKey from QuizLogMessage) – All log messages of this user (related name of student)

  • submissions (Reverse ForeignKey from Submission) – All submissions of this user (related name of student)

  • final_submissions (Reverse ForeignKey from PublishedSubmission) – All final submissions of this user (related name of student)

  • comments (Reverse ForeignKey from Comment) – All comments of this user (related name of author)

Methods

api_request

Log in to Tin via Ion

get_next_by_date_joined

Finds next instance based on date_joined.

get_previous_by_date_joined

Finds previous instance based on date_joined.

get_social_auth

Get social auth information from Ion

Attributes

REQUIRED_FIELDS

USERNAME_FIELD

comments

Type: Reverse ForeignKey from Comment

cooldown_periods

Type: Reverse ForeignKey from CooldownPeriod

courses

Type: Reverse ManyToManyField from Course

date_joined

Type: DateTimeField

email

Type: CharField

final_submissions

Type: Reverse ForeignKey from PublishedSubmission

first_name

Type: CharField

full_name

Type: CharField

groups

Type: ManyToManyField to Group

id

Type: AutoField

is_staff

Type: BooleanField

is_student

Type: BooleanField

is_superuser

Type: BooleanField

is_teacher

Type: BooleanField

last_login

Type: DateTimeField

last_name

Type: CharField

log_messages

Type: Reverse ForeignKey from QuizLogMessage

logentry_set

Type: Reverse ForeignKey from LogEntry

nickname

Type: CharField

objects

password

Type: CharField

periods

Type: Reverse ManyToManyField from Period

short_name

social_auth

Type: Reverse ForeignKey from UserSocialAuth

submissions

Type: Reverse ForeignKey from Submission

taught_courses

Type: Reverse ManyToManyField from Course

taught_periods

Type: Reverse ForeignKey from Period

user_permissions

Type: ManyToManyField to Permission

username

Type: CharField

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

api_request(url, params=None, *, refresh=True)[source]

Log in to Tin via Ion

get_social_auth()[source]

Get social auth information from Ion