You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
500 B
12 lines
500 B
from django.db import models
|
|
import uuid
|
|
from django.conf import settings
|
|
|
|
class Device(models.Model):
|
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True)
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='devices')
|
|
last_login = models.DateTimeField(auto_now=True)
|
|
device_model = models.CharField(max_length=100, blank=True, null=True)
|
|
|
|
def __str__(self):
|
|
return f"{self.user.username} : {self.device_model}"
|
|
|