title: JOIN two tables containing same foreign key in Django
body: <p>So I have two models containing primary key 'User'</p>
  
  <pre><code>class Reviews(models.Model):
      subject_user = models.ForeignKey(User,related_name='reviewed_user')
      actor = models.ForeignKey(User)                         ## irrelavent 
      text = models.TextField()
  
  class Friendship(models.Model):
      head_user = models.ForeignKey(User,related_name='followed')
      tail_user = models.ForeignKey(User)                     ## irrelavent 
  </code></pre>
  
  <p>Now I want to find all the reviews of users who are also in the <code>Friendsip.head_user</code>. For example, say <strong>User '1'</strong> wrote a review each for <strong>User '3'</strong> and <strong>User '5'</strong></p>
  
  <pre><code>Reviews:
  subject_user_id     actor_id     text
  3                   1            LoremIpsum1
  5                   1            LoremIpsum2
  
  Friendship:
  head_user           tail_user
  3                   9
  8                   9      ### Irrelavent
  </code></pre>
  
  <p>Now I output should be reviews object corresponding to 'LoremIpsum1' i.e. the review object whose subject_user is also present in <code>Friendship.head_user</code>. I tried the following</p>
  
  <pre><code>reviews = Reviews.objects.all().select_related('friendship__head_user')
  </code></pre>
  
  <p>But it is giving me all the reviews</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>This is how I insert the review:</p>
  
  <pre><code>review, created = Reviews.object.get_or_create(subject_user=target, actor=actor)
  review.text = NewReviewText
  review.save()
  </code></pre>