views.py 283 B

123456789101112
  1. from django.shortcuts import render
  2. from django.http import JsonResponse
  3. from .models import RapportoRicezione
  4. # Create your views here.
  5. def rapporti_get(request):
  6. return JsonResponse([
  7. r.serialize()
  8. for r in RapportoRicezione.objects.all()
  9. ], safe=False)