code: def _get_django_queryset(self):
          
  
          prefetches = []
          for field, fprefetch in self.prefetches.items():
              has_query = hasattr(fprefetch, 'query')
              qs = fprefetch.query.queryset if has_query else None
              prefetches.append(
                  Prefetch(field, queryset=qs)
              )
  
          queryset = self.queryset
          if prefetches:
              queryset = queryset.prefetch_related(*prefetches)
  
          return queryset
docs: Return Django QuerySet with prefetches properly configured.