Django Rest Framework slug_field error
<p>I have this serializer and model. I want to show in my API the field <em>username</em> of <strong>User</strong> model, but I receive this error.</p>

<blockquote>
  <p>AttributeError at /api/v1/client_share_requests/1/</p>
  
  <p>'Profile' object has no attribute 'username'</p>
</blockquote>

<p><strong><em>serializers.py</em></strong></p>

<pre><code>class ClientShareRequestSerializer(serializers.ModelSerializer):

    checked_by = serializers.SlugRelatedField(
        many=True,
        queryset=Profile.objects.all(),
        slug_field='username'
    )

    class Meta:
        model = ClientShareRequest
        fields = ('checked_by')
</code></pre>

<p><strong><em>models.py</em></strong></p>

<pre><code>  class Profile(models.Model):
        user = models.OneToOneField(User, related_name='profile')

  class ClientShareRequest(models.Model):
        checked_by = models.ManyToManyField(Profile, blank=True,
                                            related_name='checked_by')
</code></pre>

<p>I try to access the User model instance like this:</p>

<pre><code>   checked_by = serializers.SlugRelatedField(
        many=True,
        queryset=Profile.objects.all(),
        slug_field='user.username'
   )
</code></pre>

<p>but I receive this error:</p>

<blockquote>
  <p>'Profile' object has no attribute 'user.username'</p>
</blockquote>

<p>Thanks for helping. (Sorry for my English :P)</p>