1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Reorganised the internals of the Where node a bit to fix some copying problems.

We no longer store any reference to Django field instances or models in the
Where node. This should improve cloning speed, fix some pickling difficulties,
reduce memory usage and remove some infinite loop possibilities in odd cases.
Slightly backwards incompatible if you're writing custom filters. See the
BackwardsIncompatibleChanges wiki page for details.

Fixed #7128, #7204, #7506.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7773 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-06-27 03:27:20 +00:00
parent c237ef625c
commit ade4a1246c
4 changed files with 40 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ Various complex queries that have been problematic in the past.
"""
import datetime
import pickle
from django.db import models
from django.db.models.query import Q
@@ -791,5 +792,9 @@ Empty querysets can be merged with others.
>>> Note.objects.all() & Note.objects.none()
[]
Bug #7204, #7506 -- make sure querysets with related fields can be pickled. If
this doesn't crash, it's a Good Thing.
>>> out = pickle.dumps(Item.objects.all())
"""}