Модель для хранения вызова на рацию
This commit is contained in:
parent
a7c7705211
commit
af61982db9
31
apps/workerslocation/migrations/0003_auto_20241030_0504.py
Normal file
31
apps/workerslocation/migrations/0003_auto_20241030_0504.py
Normal 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'),
|
||||
),
|
||||
]
|
||||
18
apps/workerslocation/models/model_voice_call.py
Normal file
18
apps/workerslocation/models/model_voice_call.py
Normal 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', ]),
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user