Skip to content

Instantly share code, notes, and snippets.

@tuxcanfly
Created September 20, 2012 12:51
Show Gist options
  • Save tuxcanfly/3755704 to your computer and use it in GitHub Desktop.
Save tuxcanfly/3755704 to your computer and use it in GitHub Desktop.
django bug?
from django.contrib.auth.models import User
User.objects.create(username='admin', email='[email protected]', password='test')
ids = User.objects.none().values_list('id', flat=True)
print ids # prints []
assert User.objects.exclude(id__in=ids) # AssertionError
ids = []
assert User.objects.exclude(id__in=ids) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment