Renamed flag for detecting managers built from QuerySets with as_manager().
This commit is contained in:
parent
572ad9a92e
commit
05f702b94c
|
@ -92,7 +92,7 @@ class BaseManager(object):
|
||||||
Raises a ValueError if the manager is dynamically generated.
|
Raises a ValueError if the manager is dynamically generated.
|
||||||
"""
|
"""
|
||||||
qs_class = self._queryset_class
|
qs_class = self._queryset_class
|
||||||
if getattr(self, '_built_as_manager', False):
|
if getattr(self, '_built_with_as_manager', False):
|
||||||
# using MyQuerySet.as_manager()
|
# using MyQuerySet.as_manager()
|
||||||
return (
|
return (
|
||||||
True, # as_manager
|
True, # as_manager
|
||||||
|
|
|
@ -68,7 +68,7 @@ class QuerySet(object):
|
||||||
# Address the circular dependency between `Queryset` and `Manager`.
|
# Address the circular dependency between `Queryset` and `Manager`.
|
||||||
from django.db.models.manager import Manager
|
from django.db.models.manager import Manager
|
||||||
manager = Manager.from_queryset(cls)()
|
manager = Manager.from_queryset(cls)()
|
||||||
manager._built_as_manager = True
|
manager._built_with_as_manager = True
|
||||||
return manager
|
return manager
|
||||||
as_manager.queryset_only = True
|
as_manager.queryset_only = True
|
||||||
as_manager = classmethod(as_manager)
|
as_manager = classmethod(as_manager)
|
||||||
|
|
Loading…
Reference in New Issue