Skip to content
Snippets Groups Projects
Verified Commit 962803f8 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add RadioSettings model

parent 656492f4
No related branches found
No related tags found
No related merge requests found
# Generated by Django 4.2.11 on 2024-04-11 15:14
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("program", "0087_playlist"),
]
operations = [
migrations.CreateModel(
name="RadioSettings",
fields=[
(
"id",
models.AutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
(
"cba_api_key",
models.CharField(blank=True, max_length=64, verbose_name="CBA API key"),
),
(
"cba_domains",
models.JSONField(
blank=True,
default=list,
help_text="JSON array of strings",
verbose_name="CBA domains",
),
),
(
"playout_channels",
models.JSONField(blank=True, default=dict, help_text="JSON key/value pairs"),
),
("station_name", models.CharField(max_length=256, unique=True)),
("station_website", models.URLField()),
(
"fallback_show",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="program.show",
),
),
(
"station_logo",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="program.image",
),
),
],
options={
"verbose_name_plural": "Radio Settings",
},
),
]
......@@ -525,3 +525,21 @@ class Playlist(models.Model):
("add__line", "Can add line media-source"),
("add__stream", "Can add stream media-source"),
]
class RadioSettings(models.Model):
cba_api_key = models.CharField(blank=True, max_length=64, verbose_name="CBA API key")
cba_domains = models.JSONField(
blank=True, default=list, help_text="JSON array of strings", verbose_name="CBA domains"
)
fallback_show = models.ForeignKey(Show, blank=True, null=True, on_delete=models.CASCADE)
playout_channels = models.JSONField(blank=True, default=dict, help_text="JSON key/value pairs")
station_logo = models.ForeignKey(Image, blank=True, null=True, on_delete=models.CASCADE)
station_name = models.CharField(max_length=256, unique=True)
station_website = models.URLField()
class Meta:
verbose_name_plural = "Radio Settings"
def __str__(self):
return self.station_name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment