Проба форинкей
This commit is contained in:
1 parent
82f26cdba2
commit
8ada6829ad
6 files changed
+16
-6
No files matched your search
+12
-3
@@ -5,6 +5,8 @@ from rest_framework.views import APIView
|
||||
from .renderers import UserJSONRenderer
|
||||
from userauth.models import *
|
||||
from .models import *
|
||||
from .serializers import *
|
||||
import pandas as pd
|
||||
# from .serializers import RegistrationSerializer
|
||||
|
||||
# class RegistrationAPIView(APIView):
|
||||
@@ -36,6 +38,7 @@ class UserAPIView(APIView):
|
||||
|
||||
class getuserAPIView(APIView):
|
||||
permission_classes = (AllowAny,)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,8 +46,14 @@ class getuserAPIView(APIView):
|
||||
userlogin = request.query_params.get('userlogin')
|
||||
|
||||
queryset = model_to_dict(DictEmployee.objects.using('user_directory').get(login=userlogin))
|
||||
|
||||
# queryset['responsible'] = [model_to_dict(x) for x in OrderResponsibilityEmployee.objects.using('user_directory').raw("SELECT * FROM order_responsibility_employee")]
|
||||
|
||||
# com = Committee2.objects.using('user_directory').values('id_dict_employee')
|
||||
# emp = DictEmployee.objects.using('user_directory').values('login', 'id')
|
||||
# dfcom = pd.DataFrame.from_records(com)
|
||||
# dfemp = pd.DataFrame.from_records(emp)
|
||||
# h = dfcom.merge(dfemp, how="left", left_on="id_dict_employee", right_on="id")
|
||||
# print(h, '====================================================================')
|
||||
|
||||
|
||||
return Response(queryset)
|
||||
|
||||
|
||||
Reference in new issue
Block a user