from django.http.response import JsonResponse
from rest_framework.views import APIView

from .models import *

from Subscriptions.serializers import NotificationSerializer

from N3wtSchool import bdd

class NotificationView(APIView):
    def get(self, request):
        notifsList=bdd.getAllObjects(Notification)
        notifs_serializer=NotificationSerializer(notifsList, many=True)

        return JsonResponse(notifs_serializer.data, safe=False)