I posted this here to: http://www.djangoproject.com/documentation/db_api/
It seems that when you pass a Q() object into .filter() or .exclude(), you end up with the same results. That is, the context of the method, filter or exclude, is ignored when it receives a Q object. For example: In [1]: from django.db.models import Q In [2]: from django.contrib.auth.models import User In [3]: q = Q(username__exact='dvh') In [4]: User.objects.filter(q) Out[4]: [<User: dvh>] In [5]: User.objects.exclude(q) Out[5]: [<User: dvh>] In [6]: from django.db.models.query import QNot In [7]: q = QNot(username__exact='dvh') In [8]: User.objects.filter(q) Out[8]: [] In [9]: User.objects.exclude(q) Out[9]: [] (I have a user.username == 'dvh' in an sqlite3 database) I don't know if this is a feature, bug, or quirk, or obvious behavior, but I thought it was worthwhile to post it here as it tripped me up. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---