user=models.OneToOneField(User,on_delete=models.CASCADE,help_text=_('Select the user for this token'))
key=models.CharField(_('Key'),unique=True,default=get_random_key,max_length=16,help_text=_('The key for this token. This is used for Hawk verification.'))
secret=encrypt(models.CharField(_('Secret'),max_length=64,default=get_random_secret,help_text=_('The secret for this token. This is used for Hawk signing.')))
last_access=models.DateTimeField(_('Last access'),auto_now_add=True,help_text=_('The date and time when this token is last used.'))
# Custom manager that will retrieve the related user table as well.
objects=TokenManager()
defis_supertoken(self):
"""Boolean check if the token is belonging to a user with super user rights. Then this token is a super token.