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
30799eb0
Commit
30799eb0
authored
Jul 29, 2021
by
Bruno Martin
Browse files
code cleanup
parent
3af44cc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
courses/videos/serializers.py
courses/videos/serializers.py
+1
-7
No files found.
courses/videos/serializers.py
View file @
30799eb0
...
...
@@ -5,17 +5,11 @@ from .models import Video
class
VideoSerializer
(
serializers
.
ModelSerializer
):
file
=
serializers
.
FileField
(
read_only
=
True
)
class
Meta
:
model
=
Video
fields
=
(
'id'
,
'name'
,
'youtube_id'
,
'file'
,)
read_only_fields
=
(
'file'
,)
#def get_file(self, obj):
# with fallbacks(False):
# files = VideoFileSerializer(required=False, allow_null=True, read_only=True, **{'context': self.context}).data
# files = [f for f in files if f['file'] != None]
# return files
class
VideoFileSerializer
(
serializers
.
ModelSerializer
):
...
...
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