Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cp_video_dokku
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Dzehil
cp_video_dokku
Commits
8f237aae
Commit
8f237aae
authored
Mar 06, 2023
by
Ilya Simonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fields for playlist
parent
47a56d37
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
2 deletions
+37
-2
admin.cpython-39.pyc
apps/core/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
apps/core/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
apps/core/admin.py
+6
-1
0002_category_tag_alter_video_options_and_more.py
...rations/0002_category_tag_alter_video_options_and_more.py
+5
-1
models.py
apps/core/models.py
+26
-0
No files found.
apps/core/__pycache__/admin.cpython-39.pyc
View file @
8f237aae
No preview for this file type
apps/core/__pycache__/models.cpython-39.pyc
View file @
8f237aae
No preview for this file type
apps/core/admin.py
View file @
8f237aae
...
...
@@ -35,8 +35,13 @@ class VideoAdmin(admin.ModelAdmin):
class
PlayListAdmin
(
admin
.
ModelAdmin
):
list_display
=
[
'id'
,
'title'
,
]
list_display
=
[
'id'
,
'title'
,
'type'
]
readonly_fields
=
[
'created'
,
'updated'
]
list_filter
=
(
'type'
,
'sort'
)
inlines
=
[
TagInline
]
def
get_inlines
(
self
,
request
,
obj
):
return
self
.
inlines
if
obj
.
type
==
models
.
DYNAMIC
else
[]
class
CategoryAdmin
(
admin
.
ModelAdmin
):
...
...
apps/core/migrations/0002_category_tag_alter_video_options_and_more.py
View file @
8f237aae
# Generated by Django 4.1.7 on 2023-03-06 16:
31
# Generated by Django 4.1.7 on 2023-03-06 16:
52
import
apps.core.utils
from
django.conf
import
settings
...
...
@@ -116,6 +116,10 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
,
db_index
=
True
,
verbose_name
=
'created'
)),
(
'title'
,
models
.
CharField
(
max_length
=
255
,
verbose_name
=
'title'
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'description'
)),
(
'sort'
,
models
.
CharField
(
blank
=
True
,
choices
=
[(
'last_updated'
,
'Last updated'
),
(
'most_recently_published'
,
'Most recently published'
),
(
'title_a_z'
,
'Title A-Z'
),
(
'title_z_a'
,
'Title Z-A'
),
(
'shorter_first'
,
'Shorter first'
),
(
'longer_first'
,
'Longer first'
)],
max_length
=
255
)),
(
'type'
,
models
.
CharField
(
blank
=
True
,
choices
=
[(
'dynamic'
,
'Dynamic'
),
(
'freestyle'
,
'Freestyle'
)],
max_length
=
255
)),
(
'mrss'
,
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'mrss'
)),
(
'json'
,
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'json'
)),
(
'videos'
,
models
.
ManyToManyField
(
related_name
=
'playlist'
,
to
=
'core.video'
)),
],
options
=
{
...
...
apps/core/models.py
View file @
8f237aae
...
...
@@ -20,6 +20,28 @@ STATUS_CHOICES = (
(
FAIL
,
'Fail'
),
)
DYNAMIC
=
'dynamic'
FREESTYLE
=
'freestyle'
TYPE_CHOICES
=
(
(
DYNAMIC
,
'Dynamic'
),
(
FREESTYLE
,
'Freestyle'
),
)
LAST_UPDATED
=
'last_updated'
MOST_RECENTLY_PUBLISHED
=
'most_recently_published'
TITLE_A_Z
=
'title_a_z'
TITLE_Z_A
=
'title_z_a'
SHORTER_FIRST
=
'shorter_first'
LONGER_FIRST
=
'longer_first'
SORT_CHOICES
=
(
(
LAST_UPDATED
,
'Last updated'
),
(
MOST_RECENTLY_PUBLISHED
,
'Most recently published'
),
(
TITLE_A_Z
,
'Title A-Z'
),
(
TITLE_Z_A
,
'Title Z-A'
),
(
SHORTER_FIRST
,
'Shorter first'
),
(
LONGER_FIRST
,
'Longer first'
),
)
class
BaseModel
(
models
.
Model
):
updated
=
models
.
DateTimeField
(
_
(
'updated'
),
auto_now
=
True
,
db_index
=
True
)
...
...
@@ -144,6 +166,10 @@ class Playlist(BaseModel):
title
=
models
.
CharField
(
_
(
'title'
),
max_length
=
255
)
description
=
models
.
TextField
(
_
(
'description'
),
blank
=
True
,
null
=
True
)
videos
=
models
.
ManyToManyField
(
Video
,
related_name
=
'playlist'
)
sort
=
models
.
CharField
(
choices
=
SORT_CHOICES
,
max_length
=
255
,
blank
=
True
)
type
=
models
.
CharField
(
choices
=
TYPE_CHOICES
,
max_length
=
255
,
blank
=
True
)
mrss
=
models
.
CharField
(
_
(
'mrss'
),
max_length
=
255
,
blank
=
True
,
null
=
True
)
json
=
models
.
CharField
(
_
(
'json'
),
max_length
=
255
,
blank
=
True
,
null
=
True
)
tags
=
GenericRelation
(
TagToObject
)
class
Meta
:
...
...
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