1👍
✅
You can do this
def MyViewTwo(request):
# note you shouldn't use flat=true here
varlist = MyModel.objects.filter().values_list('fieldone','fieldtwo')
if not (fieldonevalue, fieldtwovalue) in varlist:
# Do something
Source:stackexchange.com