mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fixes #11 and some server side warnings
This commit is contained in:
parent
965e874740
commit
c502d4055d
@ -59,9 +59,9 @@ export class DocumentDetailComponent implements OnInit {
|
|||||||
private documentListViewService: DocumentListViewService) { }
|
private documentListViewService: DocumentListViewService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.correspondentService.list().subscribe(result => this.correspondents = result.results)
|
this.correspondentService.list(1,100000).subscribe(result => this.correspondents = result.results)
|
||||||
this.documentTypeService.list().subscribe(result => this.documentTypes = result.results)
|
this.documentTypeService.list(1,100000).subscribe(result => this.documentTypes = result.results)
|
||||||
this.tagService.list().subscribe(result => this.tags = result.results)
|
this.tagService.list(1,100000).subscribe(result => this.tags = result.results)
|
||||||
|
|
||||||
this.route.paramMap.subscribe(paramMap => {
|
this.route.paramMap.subscribe(paramMap => {
|
||||||
this.documentId = +paramMap.get('id')
|
this.documentId = +paramMap.get('id')
|
||||||
|
@ -52,35 +52,35 @@ class IndexView(TemplateView):
|
|||||||
|
|
||||||
class CorrespondentViewSet(ModelViewSet):
|
class CorrespondentViewSet(ModelViewSet):
|
||||||
model = Correspondent
|
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
|
serializer_class = CorrespondentSerializer
|
||||||
pagination_class = StandardPagination
|
pagination_class = StandardPagination
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
||||||
filter_class = CorrespondentFilterSet
|
filter_class = CorrespondentFilterSet
|
||||||
ordering_fields = ("name", "document_count", "last_correspondence")
|
ordering_fields = ("name", "matching_algorithm", "match", "document_count", "last_correspondence")
|
||||||
|
|
||||||
|
|
||||||
class TagViewSet(ModelViewSet):
|
class TagViewSet(ModelViewSet):
|
||||||
model = Tag
|
model = Tag
|
||||||
queryset = Tag.objects.annotate(document_count=Count('documents'))
|
queryset = Tag.objects.annotate(document_count=Count('documents')).order_by('name')
|
||||||
serializer_class = TagSerializer
|
serializer_class = TagSerializer
|
||||||
pagination_class = StandardPagination
|
pagination_class = StandardPagination
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
||||||
filter_class = TagFilterSet
|
filter_class = TagFilterSet
|
||||||
ordering_fields = ("name", "document_count")
|
ordering_fields = ("name", "matching_algorithm", "match", "document_count")
|
||||||
|
|
||||||
|
|
||||||
class DocumentTypeViewSet(ModelViewSet):
|
class DocumentTypeViewSet(ModelViewSet):
|
||||||
model = DocumentType
|
model = DocumentType
|
||||||
queryset = DocumentType.objects.annotate(document_count=Count('documents'))
|
queryset = DocumentType.objects.annotate(document_count=Count('documents')).order_by('name')
|
||||||
serializer_class = DocumentTypeSerializer
|
serializer_class = DocumentTypeSerializer
|
||||||
pagination_class = StandardPagination
|
pagination_class = StandardPagination
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
||||||
filter_class = DocumentTypeFilterSet
|
filter_class = DocumentTypeFilterSet
|
||||||
ordering_fields = ("name", "document_count")
|
ordering_fields = ("name", "matching_algorithm", "match", "document_count")
|
||||||
|
|
||||||
|
|
||||||
class DocumentViewSet(RetrieveModelMixin,
|
class DocumentViewSet(RetrieveModelMixin,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user