From c502d4055d52eb0d1b0908a5e8a5e5d14e403c39 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Wed, 4 Nov 2020 00:33:29 +0100 Subject: [PATCH] fixes #11 and some server side warnings --- .../document-detail/document-detail.component.ts | 6 +++--- src/documents/views.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 308e499a4..dcbaaa1a8 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -59,9 +59,9 @@ export class DocumentDetailComponent implements OnInit { private documentListViewService: DocumentListViewService) { } ngOnInit(): void { - this.correspondentService.list().subscribe(result => this.correspondents = result.results) - this.documentTypeService.list().subscribe(result => this.documentTypes = result.results) - this.tagService.list().subscribe(result => this.tags = result.results) + this.correspondentService.list(1,100000).subscribe(result => this.correspondents = result.results) + this.documentTypeService.list(1,100000).subscribe(result => this.documentTypes = result.results) + this.tagService.list(1,100000).subscribe(result => this.tags = result.results) this.route.paramMap.subscribe(paramMap => { this.documentId = +paramMap.get('id') diff --git a/src/documents/views.py b/src/documents/views.py index f8050a459..2740d1b68 100755 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -52,35 +52,35 @@ class IndexView(TemplateView): class CorrespondentViewSet(ModelViewSet): model = Correspondent - queryset = Correspondent.objects.annotate(document_count=Count('documents'), last_correspondence=Max('documents__created')) + queryset = Correspondent.objects.annotate(document_count=Count('documents'), last_correspondence=Max('documents__created')).order_by('name') serializer_class = CorrespondentSerializer pagination_class = StandardPagination permission_classes = (IsAuthenticated,) filter_backends = (DjangoFilterBackend, OrderingFilter) filter_class = CorrespondentFilterSet - ordering_fields = ("name", "document_count", "last_correspondence") + ordering_fields = ("name", "matching_algorithm", "match", "document_count", "last_correspondence") class TagViewSet(ModelViewSet): model = Tag - queryset = Tag.objects.annotate(document_count=Count('documents')) + queryset = Tag.objects.annotate(document_count=Count('documents')).order_by('name') serializer_class = TagSerializer pagination_class = StandardPagination permission_classes = (IsAuthenticated,) filter_backends = (DjangoFilterBackend, OrderingFilter) filter_class = TagFilterSet - ordering_fields = ("name", "document_count") + ordering_fields = ("name", "matching_algorithm", "match", "document_count") class DocumentTypeViewSet(ModelViewSet): model = DocumentType - queryset = DocumentType.objects.annotate(document_count=Count('documents')) + queryset = DocumentType.objects.annotate(document_count=Count('documents')).order_by('name') serializer_class = DocumentTypeSerializer pagination_class = StandardPagination permission_classes = (IsAuthenticated,) filter_backends = (DjangoFilterBackend, OrderingFilter) filter_class = DocumentTypeFilterSet - ordering_fields = ("name", "document_count") + ordering_fields = ("name", "matching_algorithm", "match", "document_count") class DocumentViewSet(RetrieveModelMixin,