23👍
✅
I think you are looking for the exclude()
method:
>>> Entry.objects.exclude(year=2006)
Will return all Entry objects that are not in the year 2006.
If you wish to further filter the results, you can chain this to a filter() method:
>>> Entry.objects.exclude(year=2006).filter(field='value')
Source:stackexchange.com