You cannot add __lt to __year or __month . Only the last double underscored bit considers the qualifier, all before it is considered a bypass, that is, Django will try to find a field named year in the connection table named date , which is obviously incorrect.
For something like this, you just need to compare the date directly:
date = datetime.date(year, month, 1) news = News.objects.filter(date__lt=date)
source share