User¶
Qualified name: tin.apps.users.models.User
- class User(*args, **kwargs)[source]¶
Bases:
AbstractBaseUser
,PermissionsMixin
A Tin user
- Parameters:
password (CharField) – Password
last_login (DateTimeField) – Last login
is_superuser (BooleanField) – Superuser status. Designates that this user has all permissions without explicitly assigning them.
id (AutoField) – Primary key: Id
username (CharField) – Username
full_name (CharField) – Full name
nickname (CharField) – Nickname
first_name (CharField) – First name
last_name (CharField) – Last name
email (CharField) – Email
is_staff (BooleanField) – Is staff
is_teacher (BooleanField) – Is teacher
is_student (BooleanField) – Is student
date_joined (DateTimeField) – Date joined
Relationship fields:
- Parameters:
groups (
ManyToManyField
toGroup
) – 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
toPermission
) – User permissions. Specific permissions for this user. (related name:user_set
)
Reverse relationships:
- Parameters:
logentry (Reverse
ForeignKey
fromLogEntry
) – All log entries of this user (related name ofuser
)social_auth (Reverse
ForeignKey
fromUserSocialAuth
) – All social auth of this user (related name ofuser
)taught_courses (Reverse
ManyToManyField
fromCourse
) – All taught courses of this user (related name ofteacher
)courses (Reverse
ManyToManyField
fromCourse
) – All courses of this user (related name ofstudents
)taught_periods (Reverse
ForeignKey
fromPeriod
) – All taught periods of this user (related name ofteacher
)periods (Reverse
ManyToManyField
fromPeriod
) – All periods of this user (related name ofstudents
)cooldown_periods (Reverse
ForeignKey
fromCooldownPeriod
) – All cooldown periods of this user (related name ofstudent
)log_messages (Reverse
ForeignKey
fromQuizLogMessage
) – All log messages of this user (related name ofstudent
)submissions (Reverse
ForeignKey
fromSubmission
) – All submissions of this user (related name ofstudent
)final_submissions (Reverse
ForeignKey
fromPublishedSubmission
) – All final submissions of this user (related name ofstudent
)comments (Reverse
ForeignKey
fromComment
) – All comments of this user (related name ofauthor
)
Methods
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 information from Ion
Attributes
REQUIRED_FIELDS
USERNAME_FIELD
comments
Type: Reverse
ForeignKey
fromComment
cooldown_periods
Type: Reverse
ForeignKey
fromCooldownPeriod
courses
Type: Reverse
ManyToManyField
fromCourse
date_joined
Type:
DateTimeField
email
Type:
CharField
final_submissions
Type: Reverse
ForeignKey
fromPublishedSubmission
first_name
Type:
CharField
full_name
Type:
CharField
groups
Type:
ManyToManyField
toGroup
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
fromQuizLogMessage
logentry_set
Type: Reverse
ForeignKey
fromLogEntry
nickname
Type:
CharField
objects
password
Type:
CharField
periods
Type: Reverse
ManyToManyField
fromPeriod
short_name
social_auth
Type: Reverse
ForeignKey
fromUserSocialAuth
submissions
Type: Reverse
ForeignKey
fromSubmission
taught_courses
Type: Reverse
ManyToManyField
fromCourse
taught_periods
Type: Reverse
ForeignKey
fromPeriod
user_permissions
Type:
ManyToManyField
toPermission
username
Type:
CharField
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned