Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
django-panik-nonstop
Commits
24b02ae8
Commit
24b02ae8
authored
Jun 14, 2020
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add special model for random directory segments (mix deliveries)
parent
fc386951
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
nonstop/migrations/0025_recurringrandomdirectorydiffusion_recurringrandomdirectoryoccurence.py
...omdirectorydiffusion_recurringrandomdirectoryoccurence.py
+35
-0
nonstop/models.py
nonstop/models.py
+17
-0
No files found.
nonstop/migrations/0025_recurringrandomdirectorydiffusion_recurringrandomdirectoryoccurence.py
0 → 100644
View file @
24b02ae8
# -*- 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'
)),
],
),
]
nonstop/models.py
View file @
24b02ae8
...
...
@@ -291,6 +291,23 @@ class RecurringStreamOccurence(models.Model):
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
)
def
remove_soundfile
(
sender
,
instance
=
None
,
**
kwargs
):
from
emissions.models
import
SoundFile
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment