mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Sort pictures by album in zip file
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from django.conf import settings
|
||||
from django.db.models import F
|
||||
from ninja import Query
|
||||
from ninja_extra import ControllerBase, api_controller, route
|
||||
from ninja_extra.exceptions import PermissionDenied
|
||||
@ -47,6 +48,7 @@ class PicturesController(ControllerBase):
|
||||
)
|
||||
.distinct()
|
||||
.order_by("-date")
|
||||
.annotate(album=F("parent__name"))
|
||||
)
|
||||
for picture in pictures:
|
||||
picture.full_size_url = picture.get_download_url()
|
||||
|
@ -23,6 +23,7 @@ class PictureSchema(ModelSchema):
|
||||
full_size_url: str
|
||||
compressed_url: str
|
||||
thumb_url: str
|
||||
album: str
|
||||
|
||||
|
||||
class PictureCreateRelationSchema(Schema):
|
||||
|
Reference in New Issue
Block a user