Serve upload files directly from nginx

This commit is contained in:
2025-04-06 12:08:15 +02:00
parent 91b30e7550
commit 67bc49fb21
10 changed files with 65 additions and 52 deletions

View File

@ -63,25 +63,10 @@ class UserProfileSchema(ModelSchema):
class UploadedFileSchema(ModelSchema):
class Meta:
model = QuickUploadImage
fields = ["uuid", "name", "content_type"]
fields = ["uuid", "name", "width", "height", "size"]
width: int
height: int
size: int
href: str
@staticmethod
def resolve_width(obj: QuickUploadImage):
return obj.image.width
@staticmethod
def resolve_height(obj: QuickUploadImage):
return obj.image.height
@staticmethod
def resolve_size(obj: QuickUploadImage):
return obj.image.size
@staticmethod
def resolve_href(obj: QuickUploadImage) -> str:
return obj.get_absolute_url()