This should be easy but for some reason I\'m having trouble finding it. I have the following:
App(models.Model):
...
Release(models.Model):
date = m
You should be able to use:
App.objects.annotate(release_count=Count('release')).filter(release_count__gt=0)\
.order_by('-release__date')
App.objects \
.annotate(release_count=Count('release')) \
.(release_count__gt=0) \
.order_by('-release_count')
For the bonus part, denormalizing date field looks like the only solution at the moment. And it's pretty fast too.