Fixed #50: ordering for favorites

This commit is contained in:
Eliot Berriot 2017-12-17 20:07:18 +01:00
parent 04c70116c3
commit 6ad8b212cf
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
6 changed files with 124 additions and 30 deletions

View file

@ -95,7 +95,12 @@ class TrackViewSet(TagViewSetMixin, SearchMixin, viewsets.ReadOnlyModelViewSet):
serializer_class = serializers.TrackSerializerNested
permission_classes = [ConditionalAuthentication]
search_fields = ['title', 'artist__name']
ordering_fields = ('creation_date',)
ordering_fields = (
'creation_date',
'title',
'album__title',
'artist__name',
)
def get_queryset(self):
queryset = super().get_queryset()