title: Queryset filter by variable that's in another queryset
body: <p>I am trying to filter a queryset by a variable in another queryset that hasn't been set yet. I know it sounds confusing so let me show you.</p>
  <p>Views.py</p>
  <pre><code>def ViewThreadView(request, thread):
      posts = Post.objects.filter(post_thread=thread)
      thread = Thread.objects.get(pk=thread)
      form_class = QuickReplyForm
      thread_name = thread.name
  
    
      return render(request, 'thread/viewthread.html',
                    {'thread': thread, 'posts': posts, 'thread_name': thread_name})
  </code></pre>
  <p>Post Model</p>
  <pre><code>class Post(models.Model):
      post_body = models.TextField(blank=True, null=True)
      author = models.ForeignKey(User, on_delete=models.CASCADE)
      post_date = models.DateTimeField(auto_now_add=True)
      post_thread = models.ForeignKey(Thread, on_delete=models.CASCADE)
  
      def __str__(self):
          return str(self.id) + ' | ' + str(self.author)
  
  </code></pre>
  <p>The User model is the standard Django model</p>
  <p>As of now, if I want to access the post author in the template, I'd do this</p>
  <pre><code>{% for post in posts %}
           post.author
  {% endfor %}
  </code></pre>
  <p>My question is, how do I access the tables of post.author. So if I want to filter how many posts that author has, I want to do something like <code>user_posts = Post.objects.get(author=post.author)</code>. But that can't work in the views because &quot;posts&quot; is a queryset and not a value. How can I do this?</p>