From 3aad428164c3a328042d162db3c40884eeb6377f Mon Sep 17 00:00:00 2001 From: Hironsan Date: Thu, 24 Mar 2022 15:46:04 +0900 Subject: [PATCH] Specify storage to example model --- backend/examples/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/examples/models.py b/backend/examples/models.py index ea18ea25..947a300e 100644 --- a/backend/examples/models.py +++ b/backend/examples/models.py @@ -2,6 +2,7 @@ import uuid from django.contrib.auth.models import User from django.db import models +from django_drf_filepond.models import DrfFilePondStoredStorage from .managers import ExampleManager, ExampleStateManager from projects.models import Project @@ -12,7 +13,7 @@ class Example(models.Model): uuid = models.UUIDField(default=uuid.uuid4, editable=False, db_index=True, unique=True) meta = models.JSONField(default=dict) - filename = models.FileField(default=".", max_length=1024) + filename = models.FileField(default=".", max_length=1024, storage=DrfFilePondStoredStorage()) project = models.ForeignKey(to=Project, on_delete=models.CASCADE, related_name="examples") annotations_approved_by = models.ForeignKey(to=User, on_delete=models.SET_NULL, null=True, blank=True) text = models.TextField(null=True, blank=True)