title: User and UserProfile objects in Django
body: <p>I'm having some trouble with a related field to User in my UserProfile model. </p>
  
  <p>I have this field in my UserProfile model:</p>
  
  <pre><code>friends = models.ManyToManyField(User, null=True)
  </code></pre>
  
  <p>When I call </p>
  
  <pre><code>User.objects.get(pk=234).get_profile().friends.all()
  </code></pre>
  
  <p>I get the set of friends as User objects</p>
  
  <p>When I call</p>
  
  <pre><code>User.objects.get(pk=234).friends_set.all()
  </code></pre>
  
  <p>I get a list of UserProfile objects. </p>
  
  <p>Is there a way (without changing the relationship to be with a UserProfile object) to get each side of the relationship returned as either User or UserProfile?</p>
  
  <p>EDIT:</p>
  
  <p>Sorry for the confusion i figured out what i was trying to do:</p>
  
  <pre><code>user = User.objects.get(pk=234)
  User.objects.filter(userprofile__friends=user).all()
  </code></pre>