Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
ca03dbc3
Verified
Commit
ca03dbc3
authored
4 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
feat: add Playlist model
parent
e57f5f2e
No related branches found
No related tags found
1 merge request
!59
Add playlists
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
program/migrations/0118_delete_playlist.py
+16
-0
16 additions, 0 deletions
program/migrations/0118_delete_playlist.py
program/migrations/0119_playlist.py
+48
-0
48 additions, 0 deletions
program/migrations/0119_playlist.py
program/models.py
+13
-0
13 additions, 0 deletions
program/models.py
with
77 additions
and
0 deletions
program/migrations/0118_delete_playlist.py
0 → 100644
+
16
−
0
View file @
ca03dbc3
# Generated by Django 4.2.16 on 2024-10-29 20:44
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"
program
"
,
"
0117_alter_timeslot_options
"
),
]
operations
=
[
migrations
.
DeleteModel
(
name
=
"
Playlist
"
,
),
]
This diff is collapsed.
Click to expand it.
program/migrations/0119_playlist.py
0 → 100644
+
48
−
0
View file @
ca03dbc3
# Generated by Django 4.2.16 on 2024-10-29 20:44
import
django.db.models.deletion
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"
program
"
,
"
0118_delete_playlist
"
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
"
Playlist
"
,
fields
=
[
(
"
id
"
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
"
ID
"
),
),
(
"
created_at
"
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
"
created_by
"
,
models
.
CharField
(
default
=
"
root
"
,
max_length
=
150
)),
(
"
description
"
,
models
.
TextField
(
blank
=
True
)),
(
"
playout_mode
"
,
models
.
CharField
(
blank
=
True
,
default
=
"
linear
"
,
max_length
=
8
)),
(
"
updated_at
"
,
models
.
DateTimeField
(
auto_now
=
True
,
null
=
True
)),
(
"
updated_by
"
,
models
.
CharField
(
blank
=
True
,
default
=
""
,
max_length
=
150
)),
(
"
show
"
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
"
playlists
"
,
to
=
"
program.show
"
,
),
),
],
options
=
{
"
permissions
"
:
[
(
"
add__file
"
,
"
Can add file media-source
"
),
(
"
add__import
"
,
"
Can add import media-source
"
),
(
"
add__line
"
,
"
Can add line media-source
"
),
(
"
add__m3ufile
"
,
"
Can add m3u media-source
"
),
(
"
add__stream
"
,
"
Can add stream media-source
"
),
],
},
),
]
This diff is collapsed.
Click to expand it.
program/models.py
+
13
−
0
View file @
ca03dbc3
...
...
@@ -563,6 +563,16 @@ class CBA(models.Model):
class
Playlist
(
models
.
Model
):
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created_by
=
models
.
CharField
(
max_length
=
150
,
default
=
"
root
"
)
description
=
models
.
TextField
(
blank
=
True
)
playout_mode
=
models
.
CharField
(
blank
=
True
,
null
=
False
,
default
=
"
linear
"
,
max_length
=
8
)
show
=
models
.
ForeignKey
(
"
Show
"
,
null
=
False
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
playlists
"
)
updated_at
=
models
.
DateTimeField
(
auto_now
=
True
,
blank
=
True
,
null
=
True
)
updated_by
=
models
.
CharField
(
blank
=
True
,
default
=
""
,
max_length
=
150
)
class
Meta
:
permissions
=
[
(
"
add__file
"
,
"
Can add file media-source
"
),
...
...
@@ -572,6 +582,9 @@ class Playlist(models.Model):
(
"
add__stream
"
,
"
Can add stream media-source
"
),
]
def
__str__
(
self
):
return
f
"
{
self
.
show
.
name
}
-
{
self
.
description
}
"
if
self
.
description
else
self
.
show
.
name
class
ImageAspectRadioField
(
models
.
CharField
):
validators
=
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment