forgot a sort field

This commit is contained in:
Jonas Winkler 2020-11-08 00:42:39 +01:00
parent d3b1a20a99
commit 3378ac1487
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import { FilterRule } from 'src/app/data/filter-rule';
export const DOCUMENT_SORT_FIELDS = [
{ field: "correspondent__name", name: "Correspondent" },
{ field: "document_type__name", name: "Document type" },
{ field: 'title', name: 'Title' },
{ field: 'archive_serial_number', name: 'ASN' },
{ field: 'created', name: 'Created' },

View File

@ -97,7 +97,7 @@ class DocumentViewSet(RetrieveModelMixin,
filter_class = DocumentFilterSet
search_fields = ("title", "correspondent__name", "content")
ordering_fields = (
"id", "title", "correspondent__name", "created", "modified", "added", "archive_serial_number")
"id", "title", "correspondent__name", "document_type__name", "created", "modified", "added", "archive_serial_number")
def file_response(self, pk, disposition):
#TODO: this should not be necessary here.