title: How to serialize multiple models in on serializer with Django?
body: <p>I try to combine multiple serializers into 1 so I don't have to do multiple fetch on the front end for the same page.
  Seems that I must use SerializerMethodField.</p>
  <p>My views is quite simple :</p>
  <pre><code>@api_view(['GET'])
  def get_user_profile_by_name(request, name):
      try:
          user_profile = UserProfile.objects.get(display_name=name.lower())
          serializer = UserProfileSerializer(user_profile, many=False)
          return Response(serializer.data)
      except ObjectDoesNotExist:
          message = {'detail': 'User does not exist or account has been suspended'}
          return Response(message, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  <p>As this can be accessed by Anonymous user, I can't use request.user
  All models I want to access inside UserProfileSerializer are related to UserProfile.
  So I dont really know how to setup my serializer.  ( I have more serializer to combine but I limited this to one serializer inside the serializer for the example )</p>
  <pre><code>class UserProfilePicture(serializers.ModelSerializer):
      class Meta:
          model = UserProfilePicture
          fields = '__all__'
  
  
  class UserProfileSerializer(serializers.ModelSerializer):
      profile_picture = serializers.SerializerMethodField(read_only=True)
  
      class Meta:
          model = UserProfile
          fields = '__all__'
  
      def get_profile_picture(self, obj):
          # What to do here ?
  </code></pre>
  <p>I struggle to understand how to acces &quot; user_profile &quot; object from UserProfileSerializer in order to query the right UserProfilePicture object and return the data combined inside UserProfileSerializer.</p>