Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
3da4a828
Commit
3da4a828
authored
Jul 26, 2021
by
Matheus Miranda
Browse files
Update Video file model
parent
87d47208
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
courses/videos/models.py
courses/videos/models.py
+2
-1
courses/videos/serializers.py
courses/videos/serializers.py
+1
-1
No files found.
courses/videos/models.py
View file @
3da4a828
...
...
@@ -11,11 +11,12 @@ def get_upload_path(instance, filename):
class
VideoFile
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
255
,
null
=
True
,
)
file
=
models
.
FileField
(
upload_to
=
get_upload_path
,
default
=
None
,
null
=
True
null
=
True
,
)
video
=
models
.
OneToOneField
(
'Video'
,
...
...
courses/videos/serializers.py
View file @
3da4a828
...
...
@@ -16,4 +16,4 @@ class VideoSerializer(serializers.ModelSerializer):
model
=
Video
fields
=
(
'id'
,
'name'
,
'youtube_id'
,
'file'
)
file
=
VideoFileSerializer
(
required
=
False
)
file
=
VideoFileSerializer
(
required
=
False
,
allow_null
=
True
)
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