06fff14f4536df64fbdf10b2abdfc2faea07b8bb,api/data_refinery_api/views.py,SurveyJobList,get,#SurveyJobList#Any#Any#,566
Before Change
def get(self, request, format=None):
filter_dict = request.query_params.dict()
filter_dict.pop("limit", None)
filter_dict.pop("offset", None)
jobs = SurveyJob.objects.filter(**filter_dict)
page = self.paginate_queryset(jobs)
if page is not None:
serializer = SurveyJobSerializer(page, many=True)
return self.get_paginated_response(serializer.data)
else:
serializer = SurveyJobSerializer(jobs, many=True)
return Response(serializer.data)
class DownloaderJobList(PaginatedAPIView):
List of all DownloaderJob
After Change
def get(self, request, format=None):
filter_dict = request.query_params.dict()
limit = max(int(filter_dict.pop("limit", 100)), 100)
offset = int(filter_dict.pop("offset", 0))
jobs = SurveyJob.objects.filter(**filter_dict)[offset:(offset + limit)]
serializer = SurveyJobSerializer(jobs, many=True)
return Response(serializer.data)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: AlexsLemonade/refinebio
Commit Name: 06fff14f4536df64fbdf10b2abdfc2faea07b8bb
Time: 2018-09-21
Author: rich@anomos.info
File Name: api/data_refinery_api/views.py
Class Name: SurveyJobList
Method Name: get
Project Name: AlexsLemonade/refinebio
Commit Name: 06fff14f4536df64fbdf10b2abdfc2faea07b8bb
Time: 2018-09-21
Author: rich@anomos.info
File Name: api/data_refinery_api/views.py
Class Name: ProcessorJobList
Method Name: get
Project Name: AlexsLemonade/refinebio
Commit Name: 06fff14f4536df64fbdf10b2abdfc2faea07b8bb
Time: 2018-09-21
Author: rich@anomos.info
File Name: api/data_refinery_api/views.py
Class Name: DownloaderJobList
Method Name: get