id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 19653,`Manager.get_empty_query_set` should call `get_query_set`,Simon Charette,nobody,"Now that `EmptyQuerySet` has been [https://code.djangoproject.com/ticket/19184 removed] calling `none()` on a `QuerySet` subclass returns an instance that subclass: {{{ >>> class MyQuerySet(models.query.QuerySet): pass >>> isinstance(MyQuerySet(MyModel).none(), MyQuerySet) >>> True # On django >= 1.6 }}} This is quite useful and less error prone. However, when one subclass `models.Manager` to return a `QuerySet` subclass they '''must''' override both `get_empty_query_set` and `get_query_set` to have consistent behavior. {{{ class MyManager(models.Manager): def get_query_set(self): return MyQuerySet(self.model, using=self._db) class MyModel(models.Model): objects = MyManager() >>> isinstance(MyModel.objects.none(), MyQuerySet) # Manager.none() calls get_empty_query_set under the hood >>> False >>> isinstance(MyModel.objects.all().none(), MyQuerySet) >>> True }}} Another alternative (better IMHO) is to completely remove `get_empty_query_set` since it's not documented and only used by `Manager.none` and `EmptyManager.get_query_set`. We could make `Manager.none` proxy `QuerySet.none` and `EmptyManager.get_query_set` returns `QuerySet.get_query_self(self).none()`. Attaching two patches that both pass all tests on Python 2.7.3 SQlite.",Cleanup/optimization,closed,"Database layer (models, ORM)",dev,Normal,fixed,,,Ready for checkin,1,0,0,0,0,0