我有两个文件字段的视频模型(存储在amazon s3中的媒体):
class Video(models.Model):
original = FileField(storage=S3BotoStorage())
small = FileField(storage=S3BotoStorage(), null=True)
我只上传原始视频,上传后我在amazon弹性转码中创建转换作业(并为转换后的文件指定了文件路径)。在
^{pr2}$作业完成后,我只想将文件路径保存到small
filefield。在
@receiver(job_completed, sender=Video)
def handle_converting_completed(video_id, filepath, **kwargs):
video = Video.objects.get(id=video_id)
video.small.file.name = filepath
如何在不重新上传视频的情况下做到这一点?在
目前没有回答
相关问题 更多 >
编程相关推荐