Commit 24b02ae8 authored by fred's avatar fred

add special model for random directory segments (mix deliveries)

parent fc386951
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-14 10:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('emissions', '0015_auto_20200404_1510'),
('nonstop', '0024_recurringstreamoccurence'),
]
operations = [
migrations.CreateModel(
name='RecurringRandomDirectoryDiffusion',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('directory', models.CharField(max_length=255, verbose_name='Directory')),
('is_active', models.BooleanField(default=True, verbose_name='Active')),
('jingle', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='nonstop.Jingle')),
('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='emissions.Schedule')),
],
),
migrations.CreateModel(
name='RecurringRandomDirectoryOccurence',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('datetime', models.DateTimeField(db_index=True, verbose_name='Date/time')),
('diffusion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nonstop.RecurringRandomDirectoryDiffusion')),
],
),
]
...@@ -291,6 +291,23 @@ class RecurringStreamOccurence(models.Model): ...@@ -291,6 +291,23 @@ class RecurringStreamOccurence(models.Model):
datetime = models.DateTimeField(_('Date/time'), db_index=True) datetime = models.DateTimeField(_('Date/time'), db_index=True)
class RecurringRandomDirectoryDiffusion(models.Model):
# between soundfiles and nonstop zones, this is used for the "mix
# deliveries" segment during weekend nights.
schedule = models.ForeignKey('emissions.Schedule', on_delete=models.CASCADE)
jingle = models.ForeignKey(Jingle, null=True, blank=True)
directory = models.CharField(_('Directory'), max_length=255)
is_active = models.BooleanField('Active', default=True)
def __str__(self):
return _('Recurring Random Directory for %s') % self.schedule
class RecurringRandomDirectoryOccurence(models.Model):
diffusion = models.ForeignKey(RecurringRandomDirectoryDiffusion, on_delete=models.CASCADE)
datetime = models.DateTimeField(_('Date/time'), db_index=True)
@receiver(post_delete) @receiver(post_delete)
def remove_soundfile(sender, instance=None, **kwargs): def remove_soundfile(sender, instance=None, **kwargs):
from emissions.models import SoundFile from emissions.models import SoundFile
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment