I have this line in my code where the functions return an ID and what I 
wanted was to select all records that did not belong to one of these users.

    Carbon.objects.filter(~Q(user__in = [limbo_user(), system_user(), 
retire_user()]))

What I expected to get was 

*SELECT* ••• <http://127.0.0.1:8000/dash/#> *FROM* "web_carbon" *WHERE* 
*NOT*(("web_carbon"."user_id" *IN* (5, 2, 4))

but what I actually got was

*SELECT* ••• <http://127.0.0.1:8000/dash/#> *FROM* "web_carbon" *WHERE* 
*NOT*(("web_carbon"."user_id" *IN* (5, 2, 4) *AND* "web_carbon"."user_id" 
*IS**NOT NULL*)) 

So it always returns a null set.  Is this correct behaviour and if so, does 
anyone know what the correct syntax is?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/012666c4-3fba-4fef-b8e8-55d27f06a895%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to