1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #7813 -- Allow pickling of Query classes that use select_related().

Based on a patch from Justin Bronn.

The test in this patch most likely breaks on Oracle. That's another issue.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8053 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-07-22 08:23:20 +00:00
parent 83e97ecf88
commit 8745beccb1
2 changed files with 11 additions and 0 deletions

View File

@@ -106,6 +106,8 @@ class Query(object):
Pickling support.
"""
obj_dict = self.__dict__.copy()
obj_dict['related_select_fields'] = []
obj_dict['related_select_cols'] = []
del obj_dict['connection']
return obj_dict