Commit 3da4a828 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Update Video file model

parent 87d47208
......@@ -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',
......
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment