From 0a18c819d4f7d436b3f3ebd33ca8fda5801cd64d Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Fri, 4 Dec 2020 01:17:55 +0100 Subject: [PATCH] remove _object from document results, which makes the API about 33% faster. --- src/documents/serialisers.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index e6f278f93..973ed2ae5 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -83,25 +83,16 @@ class DocumentSerializer(serializers.ModelSerializer): tags = TagsField(many=True) document_type = DocumentTypeField(allow_null=True) - correspondent_object = TagSerializer( - read_only=True, source="correspondent") - document_type_object = TagSerializer( - read_only=True, source="document_type") - tags_objects = TagSerializer(many=True, read_only=True, source="tags") - class Meta: model = Document depth = 1 fields = ( "id", "correspondent", - "correspondent_object", "document_type", - "document_type_object", "title", "content", "tags", - "tags_objects", "created", "modified", "added",