django-pivot icon indicating copy to clipboard operation
django-pivot copied to clipboard

Django Rest FrameWorks

Open fjbardelli opened this issue 5 years ago • 1 comments

is it possible to serialize the result in DRF?

fjbardelli avatar Apr 13 '20 19:04 fjbardelli

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

tombohub avatar Nov 16 '20 15:11 tombohub