Skip to content

Instantly share code, notes, and snippets.

@tuxcanfly
Created September 20, 2012 12:51
Show Gist options
  • Select an option

  • Save tuxcanfly/3755704 to your computer and use it in GitHub Desktop.

Select an option

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='test@example.com', 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