Recently found something peculiar in a filter, I can't believe its intended behaviour.
from django.contrib.auth.models import User
print User.objects.filter(id__in=User.objects.none().values_list("id",flat=True))
print User.objects.filter(id__in=User.objects.all().values_list("id",flat=True))
Oddly both of these lists return the full set of users. It actually seems to be pretty easy to "fix" if I wrap the inner query in a list function e.g.
User.objects.filter(id__in=list(User.objects.none().values_list("id")))
Then this returns what I would expect (an empty list).
Seems like a bug to me, or am I missing something?
Steve