﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34603	~Q() incorrectly interpreted as full rather than empty	Anders Kaseorg	nobody	"Since `Q()` is ([https://en.wikipedia.org/wiki/Empty_product#In_logic correctly]) interpreted as matching every row, its negation `~Q()` should be interpreted as matching no rows. However, Django incorrectly interprets `~Q()` as matching every row like `Q()`.

{{{
>>> from django.db.models import Q
>>> from my_app.models import Client
>>> Client.objects.count()
12
>>> Client.objects.filter(Q()).count()  # good, expected 12
12
>>> Client.objects.filter(~Q()).count()  # bad, expected 0
12
}}}

Related: #5261, which introduced this incorrect behavior and added an incorrect test for it."	Bug	closed	Database layer (models, ORM)	4.2	Normal	wontfix			Unreviewed	0	0	0	0	0	0
