Kaydet (Commit) 002dbd16 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Removed the bulk of the sanity checking when merging QuerySets.

It was causing too many inconvenient and unintended problems when merging
legitimate subclasses (e.g. with geo-django classes). There's still a hook
there that we use when merging ValueQuerySets, but if you try to merge two
disparate QuerySets and it breaks all that happens is you get to keep both
pieces. We're no longer penalising the useful usages just for the people who
aren't concentrating.

Fixed #7113.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 588eeb35
......@@ -583,11 +583,11 @@ class QuerySet(object):
def _merge_sanity_check(self, other):
"""
Checks that we are merging two comparable queryset classes.
Checks that we are merging two comparable queryset classes. By default
this does nothing, but see the ValuesQuerySet for an example of where
it's useful.
"""
if self.__class__ is not other.__class__:
raise TypeError("Cannot merge querysets of different types ('%s' and '%s'."
% (self.__class__.__name__, other.__class__.__name__))
pass
class ValuesQuerySet(QuerySet):
def __init__(self, *args, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment