code: def total_items(self, request):
          
          n_total = 0
          for item in self.get_queryset(request):
              n_total += item.quantity
  
          return Response(data={"quantity": n_total}, status=status.HTTP_200_OK)
docs: Get total number of items in the basket