def batch_del(request): """ 根据传入的ids列表,批量删除msk_interface内对应id的数据 :param request: :return: """ id_list = Common._json(request.GET.get("ids")) Interface.objects.filter(pk__in=id_list).delete() return JsonResponse(code=status.HTTP_200_OK)
def paged(self, request): # 过滤 queryset = Role.objects.all().order_by("id") data = Common._paged(self, serializer_class=self.serializer_class, request=request, queryset=queryset) return JsonResponse(code=status.HTTP_200_OK, ret_status=status.HTTP_200_OK, data=data)
def list(self, request, *args, **kwargs): """ :param request: :param args: :param kwargs: :return: """ data = Common._list_data(self, self.queryset) return JsonResponse(code=status.HTTP_200_OK, data=data, ret_status=status.HTTP_200_OK)
def paged(self, request): """ 分页方法 :param request: :return: """ queryset = User.objects.all().order_by("id") data = Common._paged(self, serializer_class=self.serializer_class, request=request, queryset=queryset) return JsonResponse(code=status.HTTP_200_OK, ret_status=status.HTTP_200_OK, data=data)
def batch_del(request): id_list = Common._json(request.GET.get("ids")) Role.objects.filter(pk__in=id_list).delete() return JsonResponse(code=status.HTTP_200_OK)