diff --git a/ungleichotp/otpauth/models.py b/ungleichotp/otpauth/models.py index bf58364..59c5fae 100644 --- a/ungleichotp/otpauth/models.py +++ b/ungleichotp/otpauth/models.py @@ -1,10 +1,19 @@ from django.db import models -import uuid # Create your models here. class OTPSeed(models.Model): - appuuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - appname = models.CharField(max_length=128) - username = models.CharField(max_length=128) + name = models.CharField(max_length=128) + realm = models.CharField(max_length=128) seed = models.CharField(max_length=128) - trusted = models.BooleanField(default=False) + + class Meta: + unique_together = (('name', 'realm'),) + + +# V1 +# class OTPSeed(models.Model): +# appuuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) +# appname = models.CharField(max_length=128) +# username = models.CharField(max_length=128) +# seed = models.CharField(max_length=128) +# trusted = models.BooleanField(default=False)