mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 19:19:31 +02:00
See #170: add a description field on tracks, albums, tracks
This commit is contained in:
parent
424b9f133a
commit
2bc71eecfd
38 changed files with 653 additions and 59 deletions
|
@ -100,6 +100,11 @@ class ManageArtistViewSet(
|
|||
result = serializer.save()
|
||||
return response.Response(result, status=200)
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
|
||||
class ManageAlbumViewSet(
|
||||
mixins.ListModelMixin,
|
||||
|
@ -134,6 +139,11 @@ class ManageAlbumViewSet(
|
|||
result = serializer.save()
|
||||
return response.Response(result, status=200)
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
|
||||
uploads_subquery = (
|
||||
music_models.Upload.objects.filter(track_id=OuterRef("pk"))
|
||||
|
@ -186,6 +196,11 @@ class ManageTrackViewSet(
|
|||
result = serializer.save()
|
||||
return response.Response(result, status=200)
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
|
||||
uploads_subquery = (
|
||||
music_models.Upload.objects.filter(library_id=OuterRef("pk"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue