title: Excluding a list of a user's friends from the User.objects.all() queryset in django
body: <p>In one of my views I override the get_queryset(self) method in order to return a list of users that excludes the friends of the user making the request and the same user. This is what my code looks like:</p>
  
  <pre><code>def get_queryset(self):
      all_users = User.objects.all()
      user_friends = Friend.objects.friends(self.request.user)
      # Filter all_users to exclude all elements of the user_friends queryset.
      # Filter all_users to exclude the current user making the request.
      # Return the filtered queryset.
  </code></pre>
  
  <p>I am using the <a href="https://github.com/revsys/django-friendship" rel="nofollow noreferrer">django-friendship</a> library to handle friend requests and users being friends. In the <a href="https://github.com/revsys/django-friendship#getting-data-about-friendships" rel="nofollow noreferrer">getting data about friendship section</a>, it says to get a list of all a user's friends all that needs to be done is <code>Friend.objects.friends(request.user)</code>. I am unsure if this would return a list of Friend instances or of User instances. The source code for the Friend model is <a href="https://github.com/revsys/django-friendship/blob/master/friendship/models.py" rel="nofollow noreferrer">here</a>. In either case, how would I filter the queryset <code>all_users</code> to exclude all elements of the list <code>user_friends</code>.</p>