Skip to content
Snippets Groups Projects
Commit 329a275e authored by Barnabás Czémán's avatar Barnabás Czémán
Browse files

Add author full name to news response.

parent 221f12f8
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,11 @@ from rest_framework import serializers
class ArticleListSerializer(serializers.ModelSerializer):
author_name = serializers.SerializerMethodField()
class Meta:
model = Article
fields = serializers.ALL_FIELDS
def get_author_name(self, obj):
return obj.author.user.get_full_name()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment