28 lines
815 B
Python
28 lines
815 B
Python
from rest_framework.permissions import AllowAny, IsAuthenticated
|
|
from rest_framework.response import Response
|
|
from rest_framework.views import APIView
|
|
from userauth.models import *
|
|
from navigation.models import *
|
|
from navigation.serializers import *
|
|
from userauth.serializers import *
|
|
from .models import *
|
|
from .serializers import *
|
|
|
|
|
|
class getuserAPIView(APIView):
|
|
permission_classes = (AllowAny,)
|
|
|
|
def get(self, request):
|
|
"""
|
|
Параметр: userlogin
|
|
Пример: GET /api/accounts/getuser/?userlogin=9966-00-107
|
|
Результат: Выдает все данные о пользователе
|
|
"""
|
|
|
|
queryset = DictEmployee.objects.get(login=request.query_params.get('userlogin'))
|
|
|
|
|
|
|
|
return Response(CardUserSerializer(queryset).data)
|
|
|