title: How to get count of friends of friends
body: <p>i am building a website like instagram where users can follow friends, i have been able to implement follow friend and also displaying friends of friends (mutual friend). I was not able to get the count of friends of friends; this is what i tried:</p>
  
  <p>Model:</p>
  
  <pre><code>class Profile(models.Model):
      user = models.OneToOneField(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,blank=True,null=True)
      friends = models.ManyToManyField('Profile', related_name="my_friends",blank=True)
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>@login_required
  def profile_user_view(request, username):
      #Friend of Friends
      p = Profile.objects.filter(user__username=username).order_by('-id')
      all_friends = request.user.profile.friends.values_list('pk', flat=True)
      friends_of_friend = Profile.objects.filter(pk__in=all_friends)    
  context = {
      'profile_img': p,
      'friends_of_friend': friends_of_friend,
  }
  return render(...)
  </code></pre>
  
  <p>Template:</p>
  
  <pre><code>{% for data in profile_img %}
  {% for friend in friends_of_friend %}
  {% if friend in data.friends.all %}
  &lt;li&gt;
  &lt;a href="{% url 'site:profile-view' friend.user.username %}" class="dark-grey-text"&gt;
     &lt;b&gt;{{ friend.user.username|lower }}&lt;/b&gt;
  &lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
      {{ friend.count }} #This is not showing the count of friends of friends, when i use length it displays '0 0' instead of '2' (mutual friends)
  &lt;/li&gt;
  {% endif %}
  {% endfor %}
  {% endfor %}
  </code></pre>