2022-04-02 17:30:58 +00:00
|
|
|
from django.db import models
|
2022-04-13 13:43:20 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from homelog.system_user import get_deleted_user
|
2022-04-02 17:30:58 +00:00
|
|
|
|
2022-04-13 13:43:20 +00:00
|
|
|
|
|
|
|
class Scanner(models.Model):
|
|
|
|
named_id = models.CharField(max_length=40, unique=True)
|
|
|
|
description = models.CharField(max_length=200)
|
|
|
|
lwt_topic = models.CharField(max_length=200)
|
|
|
|
last_online_ts = models.DateTimeField('last datetime this scanner has been online')
|
|
|
|
assigned_channel_name = models.CharField(max_length=200)
|
|
|
|
assigned_group_name = models.CharField(max_length=200)
|
|
|
|
created_ts = models.DateTimeField('datetime created', auto_now_add=True)
|
|
|
|
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET(get_deleted_user),
|
|
|
|
related_name='created_scanners')
|
|
|
|
changed_ts = models.DateTimeField('datetime updated', auto_now=True)
|
|
|
|
changed_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET(get_deleted_user),
|
|
|
|
related_name='changed_scanners')
|