susioma/api/views.py

13 lines
390 B
Python
Raw Normal View History

2021-10-23 18:51:03 +00:00
from django.views.generic import View
from django.http import JsonResponse
from buyer.models import Card
class AvailabilityView(View):
def get(self, request):
cards = len(Card.objects.filter(delivered__isnull=True))
2021-10-24 14:47:51 +00:00
return JsonResponse({"cards": cards})
class StatusView(View):
def get(self, request):
return JsonResponse({"status": "OK", "messages": []})