Django

Code

Changeset 7395

Show
Ignore:
Timestamp:
03/31/08 19:25:32 (5 months ago)
Author:
mtredinnick
Message:

queryset-refactor: Moved _merge_sanity_check into a more logical place in the
code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/queryset-refactor/django/db/models/query.py

    r7346 r7395  
    119119            raise IndexError, e.args 
    120120 
    121     def _merge_sanity_check(self, other): 
    122         """ 
    123         Checks that we are merging two comparable queryset classes. 
    124         """ 
    125         if self.__class__ is not other.__class__: 
    126             raise TypeError("Cannot merge querysets of different types ('%s' and '%s'." 
    127                     % (self.__class__.__name__, other.__class__.__name__)) 
    128  
    129121    def __and__(self, other): 
    130122        self._merge_sanity_check(other) 
     
    471463                self._iter = None 
    472464 
     465    def _merge_sanity_check(self, other): 
     466        """ 
     467        Checks that we are merging two comparable queryset classes. 
     468        """ 
     469        if self.__class__ is not other.__class__: 
     470            raise TypeError("Cannot merge querysets of different types ('%s' and '%s'." 
     471                    % (self.__class__.__name__, other.__class__.__name__)) 
     472 
    473473# Use the backend's QuerySet class if it defines one. Otherwise, use _QuerySet. 
    474474if connection.features.uses_custom_queryset: