diff --git a/code.json b/code.json index 49cf3e9..6f65fbe 100644 --- a/code.json +++ b/code.json @@ -3,7 +3,7 @@ "name": "liliservices", "organization": "U.S. Geological Survey", "description": "Web services for LILI (LIDE (Laboratory for Infectious Disease and the Environment) Information Management System)", - "version": "v1.1.1", + "version": "v1.2.0", "status": "Production", "permissions": { @@ -47,7 +47,7 @@ }, "date": { - "metadataLastUpdated": "2020-02-18" + "metadataLastUpdated": "2020-023-11" } } ] diff --git a/liliapi/views.py b/liliapi/views.py index b15fa66..759e157 100644 --- a/liliapi/views.py +++ b/liliapi/views.py @@ -9,6 +9,7 @@ from liliapi.serializers import * from liliapi.models import * from liliapi.permissions import * +from liliapi.paginations import * from liliapi.authentication import * from liliapi.tasks import * @@ -46,6 +47,7 @@ class HistoryViewSet(viewsets.ModelViewSet): """ permission_classes = (permissions.IsAuthenticated,) + pagination_class = StandardResultsSetPagination def perform_create(self, serializer): serializer.save(created_by=self.request.user, modified_by=self.request.user) @@ -53,6 +55,11 @@ def perform_create(self, serializer): def perform_update(self, serializer): serializer.save(modified_by=self.request.user) + # override the default pagination to allow disabling of pagination + def paginate_queryset(self, *args, **kwargs): + if self.request and 'paginate' in self.request.query_params: + return super().paginate_queryset(*args, **kwargs) + return None ###### #