26 lines
668 B
Python
26 lines
668 B
Python
from django.db import models
|
|
|
|
from apps.pla.models.model_alarm import Alarm
|
|
|
|
|
|
class VoiceCall(models.Model):
|
|
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
sent = models.BooleanField(default=False)
|
|
alarm_file = models.ForeignKey(Alarm, on_delete=models.CASCADE)
|
|
|
|
def __str__(self):
|
|
return f"{self.created_at}"
|
|
|
|
class Meta: # отображение в админики
|
|
ordering = ("created_at",)
|
|
verbose_name = "вызов"
|
|
verbose_name_plural = "вызовы"
|
|
indexes = [
|
|
models.Index(
|
|
fields=[
|
|
"created_at",
|
|
]
|
|
),
|
|
]
|