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): ...@@ -11,11 +11,12 @@ def get_upload_path(instance, filename):
class VideoFile(models.Model): class VideoFile(models.Model):
name = models.CharField( name = models.CharField(
max_length=255, max_length=255,
null=True,
) )
file = models.FileField( file = models.FileField(
upload_to=get_upload_path, upload_to=get_upload_path,
default=None, default=None,
null=True null=True,
) )
video = models.OneToOneField( video = models.OneToOneField(
'Video', 'Video',
......
...@@ -16,4 +16,4 @@ class VideoSerializer(serializers.ModelSerializer): ...@@ -16,4 +16,4 @@ class VideoSerializer(serializers.ModelSerializer):
model = Video model = Video
fields = ('id', 'name', 'youtube_id', 'file') 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