﻿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
13198	exclude() bug when used with Q() objects	mucisland	nobody	".exclude() behaves different when its argument is wrapped into Q(). Specifically, when wrapping an exclude filter with Q(), objects containing NULL in related fields are excluded as well as objects which have matching content in this field.

The SQL which is generated by exclude(<field>=<value>) should _not_ match objects with NULL in the respective field, but this is sometimes violated when wrapping the filter with Q(). (So far I've only seen this bug when using a filter which specifies a field in a related object.)

The attached file contains a minimum Django project (project name is ""sandbox"", application name is ""q"") with two test cases which should clarify the described behaviour.

Best Regards,
Dirk"	Bug	closed	Database layer (models, ORM)	1.1	Normal	fixed	exclude Q		Accepted	0	0	0	0	0	0
