Ticket #19653: 0001-Fixed-19653-Removed-Manager.get_empty_query_set.patch

File 0001-Fixed-19653-Removed-Manager.get_empty_query_set.patch, 1.3 KB (added by Simon Charette, 12 years ago)
  • django/db/models/manager.py

    From a8ac3f25a01bf3d59772912dcbc03311bb10dfd3 Mon Sep 17 00:00:00 2001
    From: Simon Charette <charette.s@gmail.com>
    Date: Tue, 22 Jan 2013 05:10:50 -0500
    Subject: [PATCH] Fixed #19653 -- Removed Manager.get_empty_query_set.
    
    ---
     django/db/models/manager.py |    7 ++-----
     1 file changed, 2 insertions(+), 5 deletions(-)
    
    diff --git a/django/db/models/manager.py b/django/db/models/manager.py
    index 816f619..cee2131 100644
    a b class Manager(object):  
    112112    # PROXIES TO QUERYSET #
    113113    #######################
    114114
    115     def get_empty_query_set(self):
    116         return QuerySet(self.model, using=self._db).none()
    117 
    118115    def get_query_set(self):
    119116        """Returns a new QuerySet object.  Subclasses can override this method
    120117        to easily customize the behavior of the Manager.
    class Manager(object):  
    122119        return QuerySet(self.model, using=self._db)
    123120
    124121    def none(self):
    125         return self.get_empty_query_set()
     122        return self.get_query_set().none()
    126123
    127124    def all(self):
    128125        return self.get_query_set()
    class EmptyManager(Manager):  
    266263        self.model = model
    267264
    268265    def get_query_set(self):
    269         return self.get_empty_query_set()
     266        return super(EmptyManager, self).get_query_set().none()
Back to Top