Select related members for storage to speed up query
This commit is contained in:
parent
4a4c358eb3
commit
8b9d5ad766
|
@ -1791,7 +1791,7 @@ class HostingViewSet(Base):
|
||||||
|
|
||||||
class StorageSpaceViewSet(Base, List, Retrieve, Update):
|
class StorageSpaceViewSet(Base, List, Retrieve, Update):
|
||||||
permission_classes = [AllowMetadata | IsAuthenticated, IsAdminOrReadOnly]
|
permission_classes = [AllowMetadata | IsAuthenticated, IsAdminOrReadOnly]
|
||||||
queryset = models.StorageSpace.objects.all().order_by('id')
|
queryset = models.StorageSpace.objects.all().select_related('user__member').order_by('id')
|
||||||
serializer_class = serializers.StorageSpaceSerializer
|
serializer_class = serializers.StorageSpaceSerializer
|
||||||
|
|
||||||
@action(detail=False, methods=['post'], permission_classes=[AllowMetadata | IsAuthenticated])
|
@action(detail=False, methods=['post'], permission_classes=[AllowMetadata | IsAuthenticated])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user