﻿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
32450	"""TypeError: cannot pickle"" when applying | operator to a Q object"	Daniel Izquierdo	nobody	"Using a reference to a non-pickleable type of object such as `dict_keys` in a `Q` object makes the `|` operator fail:

{{{
>>> from django.db.models import Q
>>> Q(x__in={}.keys())
<Q: (AND: ('x__in', dict_keys([])))>
>>> Q() | Q(x__in={}.keys())
Traceback (most recent call last):
...
TypeError: cannot pickle 'dict_keys' object
}}}

Even though this particular example could be solved by doing `Q() | Q(x__in={})` it still feels like using `.keys()` should work.

I can work on a patch if there's agreement that this should not crash."	Bug	new	Database layer (models, ORM)	3.1	Normal				Unreviewed	0	0	0	0	0	0
