- class gcampus.auth.models.BaseToken(*args, **kwargs)#
- DEFAULT_PERMISSIONS: List[Tuple[str, str]]#
List of permissions that should be applied by default to all newly created instances. Note that this is attribute is only available in subclasses.
- TOKEN_LENGTH: int#
Length in characters of the token. Required to generate a random and unique value for the
tokenfield. Note that this is attribute is only available in subclasses.
- course: ForeignKey | Course#
The course associated with this token. Note that this is a foreign key relation (many to one) for access keys while it is a one-to-one relation for course tokens.
- deactivated: BooleanField#
Whether the token is deactivated. Deactivated tokens can not be used to log in and have no permissions.
- get_all_permissions() List[str] #
Return a list of all permissions in the style of
- property is_active: bool#
Whether the user is active. This is only the case when the user is not
deactivatedand the course email is verified (see
- last_login: DateTimeField#
Date and time of the last login. Updated using the
- permissions: ManyToManyField | PermissionManager#
List of permissions (many to many field) for this token.
- token: CharField | str#
The token field contains a unique character of length
TOKEN_LENGTHused for authentication. Note that this is attribute is only available in subclasses as the length varies from model to model.
- type: TokenType#
Type of the token.
- class gcampus.auth.models.CourseToken(id, created_at, updated_at, deactivated, last_login, token, course)#