diff --git a/api/webview/views.py b/api/webview/views.py index bc077f54..d9dcec32 100644 --- a/api/webview/views.py +++ b/api/webview/views.py @@ -28,7 +28,11 @@ def perform_create(self, serializer): def get_queryset(self): """ Return all documents """ - return Document.objects.all() + queryset = Document.objects.all() + source_from_query = self.request.query_params.get('source', None) + if source_from_query is not None: + queryset = queryset.filter(source=source_from_query) + return queryset class DocumentsFromSource(generics.ListAPIView):