From 0c47907ddac0cb5b6d8461a780c2b87e49f2e4c2 Mon Sep 17 00:00:00 2001 From: khrise Date: Thu, 3 Jan 2019 16:54:32 +0000 Subject: [PATCH] Exposing documents' "added" timestamp via Rest API. --- src/documents/serialisers.py | 1 + src/documents/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index f71a0c5ab..bd00fe466 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -46,6 +46,7 @@ class DocumentSerializer(serializers.ModelSerializer): "checksum", "created", "modified", + "added", "file_name", "download_url", "thumbnail_url", diff --git a/src/documents/views.py b/src/documents/views.py index 9cb66b59c..186b733a5 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -130,7 +130,7 @@ class DocumentViewSet(RetrieveModelMixin, filter_class = DocumentFilterSet search_fields = ("title", "correspondent__name", "content") ordering_fields = ( - "id", "title", "correspondent__name", "created", "modified") + "id", "title", "correspondent__name", "created", "modified", "added") class LogViewSet(ReadOnlyModelViewSet):