Fixed #44: now bind track file to import job

This commit is contained in:
Eliot Berriot 2017-12-14 23:06:21 +01:00
parent a08bf51216
commit e90e9dc7aa
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
14 changed files with 181 additions and 16 deletions

View file

@ -72,7 +72,10 @@ class AlbumViewSet(SearchMixin, viewsets.ReadOnlyModelViewSet):
class ImportBatchViewSet(viewsets.ReadOnlyModelViewSet):
queryset = models.ImportBatch.objects.all().order_by('-creation_date')
queryset = (
models.ImportBatch.objects.all()
.prefetch_related('jobs__track_file')
.order_by('-creation_date'))
serializer_class = serializers.ImportBatchSerializer
def get_queryset(self):