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
7eebea97
Commit
7eebea97
authored
Mar 06, 2023
by
Ilya Simonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add category for video
parent
c6c0adc3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
1 deletion
+31
-1
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
+5
-0
0002_category_video_closed_captions_video_creator_and_more.py
..._category_video_closed_captions_video_creator_and_more.py
+13
-1
0002_category_video_closed_captions_video_creator_and_more.cpython-39.pyc
...deo_closed_captions_video_creator_and_more.cpython-39.pyc
+0
-0
0002_video_closed_captions_video_creator_and_more.cpython-39.pyc
...deo_closed_captions_video_creator_and_more.cpython-39.pyc
+0
-0
models.py
apps/core/models.py
+13
-0
No files found.
apps/core/__pycache__/admin.cpython-39.pyc
View file @
7eebea97
No preview for this file type
apps/core/__pycache__/models.cpython-39.pyc
View file @
7eebea97
No preview for this file type
apps/core/admin.py
View file @
7eebea97
...
...
@@ -18,5 +18,10 @@ class PlayListAdmin(admin.ModelAdmin):
readonly_fields
=
[
'created'
,
'updated'
]
class
CategoryAdmin
(
admin
.
ModelAdmin
):
list_display
=
[
'id'
,
'name'
,
]
admin
.
site
.
register
(
models
.
Video
,
VideoAdmin
)
admin
.
site
.
register
(
models
.
Playlist
,
PlayListAdmin
)
admin
.
site
.
register
(
models
.
Category
,
CategoryAdmin
)
apps/core/migrations/0002_video_closed_captions_video_creator_and_more.py
→
apps/core/migrations/0002_
category_
video_closed_captions_video_creator_and_more.py
View file @
7eebea97
# Generated by Django 4.1.7 on 2023-03-06 1
3:56
# Generated by Django 4.1.7 on 2023-03-06 1
4:07
import
apps.core.utils
from
django.conf
import
settings
...
...
@@ -15,6 +15,13 @@ class Migration(migrations.Migration):
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Category'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
verbose_name
=
'name'
)),
],
),
migrations
.
AddField
(
model_name
=
'video'
,
name
=
'closed_captions'
,
...
...
@@ -80,4 +87,9 @@ class Migration(migrations.Migration):
'ordering'
:
(
'title'
,),
},
),
migrations
.
AddField
(
model_name
=
'video'
,
name
=
'categories'
,
field
=
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'video'
,
to
=
'core.category'
,
verbose_name
=
'categories'
),
),
]
apps/core/migrations/__pycache__/0002_category_video_closed_captions_video_creator_and_more.cpython-39.pyc
0 → 100644
View file @
7eebea97
File added
apps/core/migrations/__pycache__/0002_video_closed_captions_video_creator_and_more.cpython-39.pyc
deleted
100644 → 0
View file @
c6c0adc3
File deleted
apps/core/models.py
View file @
7eebea97
...
...
@@ -27,6 +27,13 @@ class BaseModel(models.Model):
abstract
=
True
class
Category
(
models
.
Model
):
name
=
models
.
CharField
(
'name'
,
max_length
=
255
,
db_index
=
True
)
def
__str__
(
self
):
return
self
.
name
class
Video
(
BaseModel
):
title
=
models
.
CharField
(
_
(
'title'
),
max_length
=
255
)
slug
=
models
.
SlugField
(
_
(
'slug'
),
max_length
=
255
,
unique
=
True
,
blank
=
True
)
...
...
@@ -72,6 +79,12 @@ class Video(BaseModel):
blank
=
True
,
null
=
True
,
)
categories
=
models
.
ManyToManyField
(
Category
,
verbose_name
=
'categories'
,
related_name
=
'video'
,
blank
=
True
,
)
class
Meta
:
ordering
=
(
'title'
,)
...
...
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