From 815c92b8a87a4884c72a082a9c76aef49c2d40cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Caux?= <git@jscaux.org> Date: Sat, 26 Feb 2022 05:20:57 +0100 Subject: [PATCH] Add fields to Publication serializer --- .../journals/api/serializers/publication.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scipost_django/journals/api/serializers/publication.py b/scipost_django/journals/api/serializers/publication.py index c202fc5a6..158f72da9 100644 --- a/scipost_django/journals/api/serializers/publication.py +++ b/scipost_django/journals/api/serializers/publication.py @@ -10,7 +10,12 @@ from ...models import Publication class PublicationPublicSerializer(DynamicFieldsModelSerializer): url = serializers.URLField(source="get_absolute_url") + doi = serializers.URLField(source="doi_string") accepted_submission = serializers.SerializerMethodField() + acad_field = serializers.StringRelatedField() + specialties = serializers.StringRelatedField(many=True) + topics = serializers.StringRelatedField(many=True) + approaches = serializers.StringRelatedField() class Meta: model = Publication @@ -20,8 +25,16 @@ class PublicationPublicSerializer(DynamicFieldsModelSerializer): "author_list", "abstract", "doi_label", + "doi", + "submission_date", + "acceptance_date", "publication_date", + "cc_license", "accepted_submission", + "acad_field", + "specialties", + "topics", + "approaches", ] def get_accepted_submission(self, obj): -- GitLab