Модель для хранения вызова на рацию

This commit is contained in:
zakhy 2024-10-30 12:04:39 +07:00
parent a7c7705211
commit af61982db9
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,31 @@
# Generated by Django 3.2.16 on 2024-10-30 05:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workerslocation', '0002_workerslocation_active'),
]
operations = [
migrations.CreateModel(
name='VoiceCall',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateField(auto_now_add=True)),
('sent', models.BooleanField(default=False)),
('filename', models.CharField(max_length=128)),
],
options={
'verbose_name': 'вызов',
'verbose_name_plural': 'вызовы',
'ordering': ('created_at',),
},
),
migrations.AddIndex(
model_name='voicecall',
index=models.Index(fields=['created_at'], name='workersloca_created_757c4c_idx'),
),
]

View File

@ -0,0 +1,18 @@
from django.db import models
class VoiceCall(models.Model):
created_at = models.DateField(auto_now_add=True)
sent = models.BooleanField(default=False)
filename = models.CharField(max_length=128)
def __str__(self):
return f'{self.created_at}'
class Meta: # отображение в админики
ordering = ('created_at',)
verbose_name = u'вызов'
verbose_name_plural = u'вызовы'
indexes = [
models.Index(fields=['created_at', ]),
]