Skip to content

Instantly share code, notes, and snippets.

@yoandresaav
Created March 18, 2020 01:43
Show Gist options
  • Save yoandresaav/b6a8c6237337add8cbac749648444f87 to your computer and use it in GitHub Desktop.
Save yoandresaav/b6a8c6237337add8cbac749648444f87 to your computer and use it in GitHub Desktop.
full_name = serializers.SerializerMethodField('get_user_full_name')
def get_user_full_name(self, obj):
request = self.context['request']
user = request.user
name = user.first_name + " " + user.last_name
return name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment