title: Filter queryset by subquery on two conditions
body: <p>I need to filter SomeModel queryset on max date by groups (user field). The Model looks like:</p>
  <pre><code>class SomeModel(models.Model):
      user = models.ForeignKey(User, on_delete=models.CASCADE)
      date = models.DateField(default=date.today)
      ...
  </code></pre>
  <p>I've already created some kind of subquery:</p>
  <pre><code>from django.db.models import Max
  
  subquery = (SomeModel.objects
              .all()
              .values('user')
              .annotate(latest_date=Max('date')))
  </code></pre>
  <p>So I want to use this subquery to filter SomeModel queryset on two conditions:</p>
  <pre><code># pseudocode 
  
  SomeModel.objects.filter(user==subquery.user and time==subquery.latest_time)
  </code></pre>
  <p>Is it possible at all or my approach is wrong?</p>