示例#1
0
 def get(self, request):
     crontabSchedule = CrontabSchedule.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=crontabSchedule,
                                       request=request,
                                       view=self)
     serializer = CrontabScheduleSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(serializer.data)
示例#2
0
 def get(self, request):
     depart = Depart.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=depart,
                                       request=request,
                                       view=self)
     serializer = DepartSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(
         serializer.data)  #Response(serializer.data)
示例#3
0
 def get(self, request):
     name = request.GET.get("roleName")
     if not name is None:
         group = Group.objects.filter(name__icontains=name).order_by('id')
     else:
         group = Group.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=group, request=request, view=self)
     serializer = GroupSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(serializer.data)#Response(serializer.data)
 def get(self, request):
     username = request.GET.get("userName")
     if not username is None:
         user = UserProfile.objects.filter(username__icontains=username).order_by('id')
     else:
         user = UserProfile.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=user, request=request, view=self)
     serializer = UserProfileSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(serializer.data)#Response(serializer.data)
 def get(self, request):
     contentTypeName = request.GET.get("contentTypeName")
     if not contentTypeName is None:
         contentType = ContentType.objects.filter(model__icontains=contentTypeName).order_by('id')
     else:
         contentType = ContentType.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=contentType, request=request, view=self)
     serializer = ContentTypeSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(serializer.data)#Response(serializer.data)
 def get(self, request):
     intervalSchedulePeriodName = request.GET.get('intervalSchedulePeriodName')
     if intervalSchedulePeriodName:
         intervalSchedule = IntervalSchedule.objects.filter(period__icontains=intervalSchedulePeriodName).order_by('id')
     else:
         intervalSchedule = IntervalSchedule.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=intervalSchedule, request=request, view=self)
     serializer = IntervalScheduleSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(serializer.data)
示例#7
0
 def get(self, request):
     periodicTaskName = request.GET.get('periodicTaskName')
     if periodicTaskName:
         periodicTask = PeriodicTask.objects.filter(
             name__icontains=periodicTaskName).order_by('id')
     else:
         periodicTask = PeriodicTask.objects.all().order_by('id')
     pg = StandardPageNumberPagination()
     page_roles = pg.paginate_queryset(queryset=periodicTask,
                                       request=request,
                                       view=self)
     serializer = PeriodicTaskSerializer(instance=page_roles, many=True)
     return pg.get_paginated_response(serializer.data)