Django excluding specific instances from queryset without using field lookup

The Given answer is perfect and try this which works fine for me

step 1)

 from django.db.models import Q

step 2)

 MyModel.objects.filter(~Q(id__in=[o.id for o in <unwanted objects>]))

The way you're already doing it is the best way.

If it's a model-agnostic way of doing this you're looking for, don't forget that you can do query.exclude(pk=instance.pk).

Just as an aside, if Django's ORM had an identity mapper (which it doesn't at present), then you would be able to do something like MyModel.objects.filter(<query>).all().remove(<instance>), but you're out of luck in that regard. The way you're doing it (or the one above) is the best you've got.

Oh, and also you can do much better than that in query with a list comprehension: query.exclude(id__in=[o.id for o in <unwanted objects>])