mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
feat: Ajout des Bundles de fichiers [#24]
This commit is contained in:
34
Back-End/Subscriptions/views/guardian_views.py
Normal file
34
Back-End/Subscriptions/views/guardian_views.py
Normal file
@ -0,0 +1,34 @@
|
||||
from django.http.response import JsonResponse
|
||||
from rest_framework.views import APIView
|
||||
from drf_yasg.utils import swagger_auto_schema
|
||||
from drf_yasg import openapi
|
||||
|
||||
from Subscriptions.models import Guardian
|
||||
from N3wtSchool import bdd
|
||||
|
||||
class GuardianView(APIView):
|
||||
"""
|
||||
Gestion des responsables légaux.
|
||||
"""
|
||||
|
||||
@swagger_auto_schema(
|
||||
operation_description="Récupère le dernier ID de responsable légal créé",
|
||||
operation_summary="Récupèrer le dernier ID de responsable légal créé",
|
||||
responses={
|
||||
200: openapi.Response(
|
||||
description="Dernier ID du responsable légal",
|
||||
schema=openapi.Schema(
|
||||
type=openapi.TYPE_OBJECT,
|
||||
properties={
|
||||
'lastid': openapi.Schema(
|
||||
type=openapi.TYPE_INTEGER,
|
||||
description="Dernier ID créé"
|
||||
)
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
def get(self, request):
|
||||
lastGuardian = bdd.getLastId(Guardian)
|
||||
return JsonResponse({"lastid":lastGuardian}, safe=False)
|
||||
Reference in New Issue
Block a user