feat(api): split api into multiple apps (#1626)
Fixes #1622 - split the api into 4 apps: core, history, schedule, storage - exploded the settings into testing/prod
This commit is contained in:
parent
87d2da9d84
commit
fce988aef1
120 changed files with 1499 additions and 1078 deletions
8
api/libretime_api/history/models/__init__.py
Normal file
8
api/libretime_api/history/models/__init__.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from .listener import ListenerCount, MountName, Timestamp
|
||||
from .live import LiveLog
|
||||
from .played import (
|
||||
PlayoutHistory,
|
||||
PlayoutHistoryMetadata,
|
||||
PlayoutHistoryTemplate,
|
||||
PlayoutHistoryTemplateField,
|
||||
)
|
27
api/libretime_api/history/models/listener.py
Normal file
27
api/libretime_api/history/models/listener.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class MountName(models.Model):
|
||||
mount_name = models.CharField(max_length=1024)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_mount_name"
|
||||
|
||||
|
||||
class Timestamp(models.Model):
|
||||
timestamp = models.DateTimeField()
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_timestamp"
|
||||
|
||||
|
||||
class ListenerCount(models.Model):
|
||||
timestamp = models.ForeignKey("Timestamp", models.DO_NOTHING)
|
||||
mount_name = models.ForeignKey("MountName", models.DO_NOTHING)
|
||||
listener_count = models.IntegerField()
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_listener_count"
|
11
api/libretime_api/history/models/live.py
Normal file
11
api/libretime_api/history/models/live.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class LiveLog(models.Model):
|
||||
state = models.CharField(max_length=32)
|
||||
start_time = models.DateTimeField()
|
||||
end_time = models.DateTimeField(blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_live_log"
|
46
api/libretime_api/history/models/played.py
Normal file
46
api/libretime_api/history/models/played.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class PlayoutHistory(models.Model):
|
||||
file = models.ForeignKey("storage.File", models.DO_NOTHING, blank=True, null=True)
|
||||
starts = models.DateTimeField()
|
||||
ends = models.DateTimeField(blank=True, null=True)
|
||||
instance = models.ForeignKey(
|
||||
"schedule.ShowInstance", models.DO_NOTHING, blank=True, null=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_playout_history"
|
||||
|
||||
|
||||
class PlayoutHistoryMetadata(models.Model):
|
||||
history = models.ForeignKey("PlayoutHistory", models.DO_NOTHING)
|
||||
key = models.CharField(max_length=128)
|
||||
value = models.CharField(max_length=128)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_playout_history_metadata"
|
||||
|
||||
|
||||
class PlayoutHistoryTemplate(models.Model):
|
||||
name = models.CharField(max_length=128)
|
||||
type = models.CharField(max_length=35)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_playout_history_template"
|
||||
|
||||
|
||||
class PlayoutHistoryTemplateField(models.Model):
|
||||
template = models.ForeignKey("PlayoutHistoryTemplate", models.DO_NOTHING)
|
||||
name = models.CharField(max_length=128)
|
||||
label = models.CharField(max_length=128)
|
||||
type = models.CharField(max_length=128)
|
||||
is_file_md = models.BooleanField()
|
||||
position = models.IntegerField()
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_playout_history_template_field"
|
Loading…
Add table
Add a link
Reference in a new issue