Views and logic for custom radios

This commit is contained in:
Eliot Berriot 2018-01-07 22:13:32 +01:00
parent df63252105
commit e7f0c1b88b
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
13 changed files with 774 additions and 18 deletions

View file

@ -116,13 +116,7 @@ class TrackViewSet(TagViewSetMixin, SearchMixin, viewsets.ReadOnlyModelViewSet):
"""
A simple ViewSet for viewing and editing accounts.
"""
queryset = (models.Track.objects.all()
.select_related()
.select_related('album__artist')
.prefetch_related(
'tags',
'files',
'artist__albums__tracks__tags'))
queryset = (models.Track.objects.all().for_nested_serialization())
serializer_class = serializers.TrackSerializerNested
permission_classes = [ConditionalAuthentication]
search_fields = ['title', 'artist__name']