This commit is contained in:
Egor Matveev
2021-11-20 23:15:11 +03:00
parent 9a20711820
commit 68245ffa43
89 changed files with 139 additions and 2283 deletions

17
Main/models/token.py Normal file
View File

@@ -0,0 +1,17 @@
from random import choice
from django.db.models import JSONField
from django.db import models
from django.utils import timezone
def create_token():
symbols = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890'
return "".join([choice(symbols) for _ in range(30)])
class Token(models.Model):
token = models.CharField(max_length=30, default=create_token)
created_dt = models.DateTimeField(default=timezone.now)
reason = models.CharField(max_length=20)
extras = JSONField()