-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticle.py
More file actions
43 lines (38 loc) · 1.16 KB
/
article.py
File metadata and controls
43 lines (38 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from jdhapi.serializers.abstract import AbstractSerializer
from rest_framework import serializers
from ..models.article import Article
from .tag import TagSerializer
from .issue import IssueSerializer
from .author import AuthorSlimSerializer
class ArticleSerializer(serializers.ModelSerializer):
tags = TagSerializer(many=True)
issue = IssueSerializer()
abstract = AbstractSerializer()
authors = AuthorSlimSerializer(many=True)
kernel_language = serializers.SerializerMethodField()
def get_kernel_language(self, obj):
return obj.get_kernel_language()
class Meta:
model = Article
fields = [
"abstract",
"repository_url",
"status",
"publication_date",
"repository_type",
"copyright_type",
"notebook_url",
"notebook_commit_hash",
"notebook_path",
"binder_url",
"doi",
"dataverse_url",
"data",
"citation",
"kernel_language",
"tags",
"issue",
"authors",
"ojs_submission_id",
"fingerprint",
]