﻿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
24381	Cache pickling exception in 1.8a1 with cross-table filter params	Mark Tranchant	nobody	"In 1.7.4 (and prior versions back to at least 2011), I can run the following transcript in ../manage.py shell. The Contributor model has two ForeignKeys, to MyModel and Task, so I'm looking up all MyModels which have a referring contributor associated with task 4.

{{{
>>> from MyProject.models import *
>>> from django.core.cache import cache
>>> cl = MyModel.objects.filter(contributor__task__id=4)
>>> cl
<<< []
>>> type(cl)
<<< django.db.models.query.QuerySet
>>> cache.set('testing', cl)
>>> cache.get('testing')
<<< []
}}}

In 1.8a1, the cache set operation generates an exception. See attachment for trace.

{{{
PicklingError: Can't pickle <type 'module'>: it's not found as __builtin__.module
}}}

If I try to cache a simple empty QuerySet (MyModel.objects.filter(id=0), for example), it works."	Bug	new	Core (Cache system)	1.8alpha1	Release blocker		cache pickle empty queryset		Unreviewed	0	0	0	0	0	0
