2018-10-26 21:08:01 +02:00
|
|
|
from django.db import models
|
2018-11-17 21:45:53 +01:00
|
|
|
from django.contrib.auth.models import AbstractUser
|
2018-10-26 21:08:01 +02:00
|
|
|
|
|
|
|
# Create your models here.
|
2018-11-17 23:00:36 +01:00
|
|
|
class OTPSeed(AbstractUser):
|
2018-11-17 10:01:24 +01:00
|
|
|
id = models.AutoField(primary_key=True)
|
2018-11-17 09:42:34 +01:00
|
|
|
name = models.CharField(max_length=128)
|
|
|
|
realm = models.CharField(max_length=128)
|
2018-10-26 21:48:21 +02:00
|
|
|
seed = models.CharField(max_length=128)
|
2018-11-17 09:42:34 +01:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
unique_together = (('name', 'realm'),)
|
|
|
|
|
2018-11-17 10:14:37 +01:00
|
|
|
def __str__(self):
|
|
|
|
return "'{}'@{}".format(self.name, self.realm)
|
2018-11-17 21:45:53 +01:00
|
|
|
|
|
|
|
# @classmethod
|
|
|
|
# def get_username(cls):
|
|
|
|
# pass
|
|
|
|
|
|
|
|
# @classmethod
|
|
|
|
# def check_password(cls, raw_password):
|
|
|
|
# """ receives a time based token"""
|
|
|
|
# pass
|
|
|
|
|
|
|
|
# @classmethod
|
|
|
|
# def has_usable_password(cls):
|
|
|
|
# pass
|