0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Renamed flag for detecting managers built from QuerySets with as_manager().

This commit is contained in:
Markus Holtermann 2015-01-05 14:36:24 +01:00 committed by Tim Graham
parent 572ad9a92e
commit 05f702b94c
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ class BaseManager(object):
Raises a ValueError if the manager is dynamically generated.
"""
qs_class = self._queryset_class
if getattr(self, '_built_as_manager', False):
if getattr(self, '_built_with_as_manager', False):
# using MyQuerySet.as_manager()
return (
True, # as_manager

View File

@ -68,7 +68,7 @@ class QuerySet(object):
# Address the circular dependency between `Queryset` and `Manager`.
from django.db.models.manager import Manager
manager = Manager.from_queryset(cls)()
manager._built_as_manager = True
manager._built_with_as_manager = True
return manager
as_manager.queryset_only = True
as_manager = classmethod(as_manager)