mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Serve upload files directly from nginx
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user