django-pivot
django-pivot copied to clipboard
Django Rest FrameWorks
is it possible to serialize the result in DRF?
I did it:
` from rest_framework.response import Response from rest_framework.decorators import api_view
@api_view() def inventory_stock(request): stock = pivot(Transaction, 'product__name', 'location__name', 'quantity') return Response(stock) `
better: https://hastebin.com/suwukadabe.py