kumidc/authentication/models/session.py

12 lines
360 B
Python
Raw Normal View History

2022-08-04 11:15:10 +00:00
from django.db import models
from django.contrib.auth import get_user_model
from uuid import uuid4
from ..helpers.session import session_expiry
class AuthSession(models.Model):
id = models.UUIDField(default=uuid4, primary_key=True)
user = models.ForeignKey(get_user_model(), models.CASCADE)
expiry = models.DateTimeField(default=session_expiry)