Browse Source

fix(video): update queryset optimization to prefetch playlists instead of videos

master
mortezaei 6 months ago
parent
commit
8ee3c093c1
  1. 4
      apps/video/views.py

4
apps/video/views.py

@ -30,10 +30,10 @@ class VideoCategoryListAPIView(generics.ListAPIView):
def get_queryset(self):
"""
Optimized queryset with prefetch_related for videos
Optimized queryset with prefetch_related for playlists
"""
return VideoCategory.objects.filter(status=True).prefetch_related(
'videos'
'playlists'
).order_by('order')

Loading…
Cancel
Save