Skip to content

Commit

Permalink
increase default pagination (#39)
Browse files Browse the repository at this point in the history
reverse the order for the execution list
  • Loading branch information
aclowes authored Jun 3, 2018
1 parent ed2680f commit 88ab7b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yawn/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'rest_framework.authentication.SessionAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10,
'PAGE_SIZE': 100,
'TEST_REQUEST_DEFAULT_FORMAT': 'json',
}

Expand Down
4 changes: 2 additions & 2 deletions yawn/task/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExecutionViewSet(viewsets.GenericViewSet,
"""
GET a list of Executions
"""
queryset = Execution.objects.all().order_by('id').select_related(
queryset = Execution.objects.all().order_by('-id').select_related(
'worker', 'task__template__workflow__name')

serializer_class = ExecutionListSerializer
Expand All @@ -34,5 +34,5 @@ def get_queryset(self):
worker = self.request.query_params.get('worker')
if worker is not None:
# worker page filters and reverses the order
queryset = queryset.filter(worker_id=worker).order_by('-id')
queryset = queryset.filter(worker_id=worker)
return queryset
1 change: 1 addition & 0 deletions yawn/workflow/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class WorkflowNameViewSet(viewsets.ReadOnlyModelViewSet):
"""
queryset = WorkflowName.objects.select_related('current_version').annotate(
task_count=Count('current_version__template')).order_by('id')
page_size = 100000 # not much pagination

serializer_class = WorkflowNameSerializer

Expand Down

0 comments on commit 88ab7b6

Please sign in to comment.