title: Django REST - Custom Serializer for Full Username
body: <p>I have an application with Django/Django-REST on the backend with Angular on the front-end. I am looking for the correct way to convert a user ID to a full username for display in an Angular JS modal.</p>
  
  <p>Here is my serializer:</p>
  
  <pre><code>from rest_framework import serializers
  from .models import ArtnetTasks
  from django.contrib.auth.models import User
  
  
  class TaskSerializer(serializers.ModelSerializer):
      date_assigned = serializers.DateTimeField(format='%Y-%m-%d')
      assigned_by_name = serializers.SerializerMethodField('full_username')
      assigned_to_name = serializers.SerializerMethodField('full_username')
  
      def full_username(self, id):
  
          user = User.objects.get(id=id)
          name = user.first_name + " " + user.last_name
          return name
  
      class Meta:
          model = ArtnetTasks, Users
          fields = ('id', 'headline', 'message', 'assigned_to', 'assigned_to_name', 'assigned_by', 'assigned_by_name', 'date_assigned', )
  </code></pre>
  
  <p>My Model:</p>
  
  <pre><code>class ArtnetTasks(models.Model):
      id = models.IntegerField(primary_key=True)
      headline = models.CharField(max_length=75L)
      message = models.TextField()
      response_message = models.TextField(blank=True)
      assigned_to = models.IntegerField(null=True, blank=True)
      assigned_by = models.IntegerField(null=True, blank=True)
      date_assigned = models.DateTimeField()
      date_completed = models.DateTimeField(null=True, blank=True)
      is_active = models.IntegerField(null=True, blank=True)
      date_updated = models.DateTimeField(null=True, blank=True)
      class Meta:
          db_table = 'artnet_tasks'
  </code></pre>
  
  <p>assigned_to and assigned_by are user_id's that correspond with auth_user</p>
  
  <p>It is throwing the following error then promptly breaking the Angular AJAX calls, the error from what I can tell is "argument must be a string or a number\054 not 'dict'"</p>
  
  <p>This is my first project using both Django-REST and Angular and am sure I am missing something obvious.</p>
  
  <p>Thanks in advance!</p>