/
home
/
report
/
liman_adapter
/
Gorooh
/
File Upload :
llllll
Current File: //home/report/liman_adapter/Gorooh/api.py
import json from rest_framework import viewsets from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status from django.http import JsonResponse from Core.table_engine.src.table_engine import TableEngine from .models import Gorooh from .serializer import GoroohSerializer class GoroohApi(viewsets.ModelViewSet): queryset = Gorooh.objects.all() serializer_class = GoroohSerializer http_method_names = ['get', 'post', 'patch', 'put', 'delete'] @staticmethod @api_view(['POST']) def table(request): try: table_engine = TableEngine(Gorooh.objects, request.dict).init_cols( ["ID", "name", "GID"]).execute() return JsonResponse(table_engine) except Exception as e: return Response(str(e), 422)
Copyright ©2k19 -
Hexid
|
Tex7ure