class Article(models.Model):
    title = models.CharField(max_length=150, verbose_name=_('title'))
pub_date = models.DateTimeField(verbose_name=_('publishing date'))
pub_year = models.IntegerField()
How to do this GROUP BY query in Django's ORM with annotate and aggregate