1

我有以下模型。我想压缩上传的文档,然后在POST请求完成时提供解压缩文件的链接。如何lz4在基于类的视图中使用来压缩或解压缩包含图像的有效负载?

模型.py

class EmployeeDocument(models.Model):
    """
    Model, Which holds Employee documents uploaded.

    """
    employee = models.ForeignKey(
        Employee, related_name="employee_docs", null=True, blank=True)
    document = models.FileField(
        upload_to='Images/', default='Images/None/No-img.jpg')
    details = models.TextField()

    def __str__(self):
        return 'DOC - %s' % (self.employee.user.username)
4

0 回答 0