mirror of
https://github.com/django/django.git
synced 2025-11-28 14:37:59 +00:00
Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
This commit is contained in:
parent
70ec4d776e
commit
210d0489c5
84 changed files with 287 additions and 189 deletions
|
|
@ -11,9 +11,7 @@ from collections import OrderedDict
|
|||
import copy
|
||||
import warnings
|
||||
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.tree import Node
|
||||
from django.utils import six
|
||||
from django.core.exceptions import FieldError
|
||||
from django.db import connections, DEFAULT_DB_ALIAS
|
||||
from django.db.models.constants import LOOKUP_SEP
|
||||
from django.db.models.aggregates import refs_aggregate
|
||||
|
|
@ -29,7 +27,10 @@ from django.db.models.sql.datastructures import EmptyResultSet, Empty, MultiJoin
|
|||
from django.db.models.sql.expressions import SQLEvaluator
|
||||
from django.db.models.sql.where import (WhereNode, Constraint, EverythingNode,
|
||||
ExtraWhere, AND, OR, EmptyWhere)
|
||||
from django.core.exceptions import FieldError
|
||||
from django.utils import six
|
||||
from django.utils.deprecation import RemovedInDjango19Warning
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.tree import Node
|
||||
|
||||
__all__ = ['Query', 'RawQuery']
|
||||
|
||||
|
|
@ -1043,7 +1044,7 @@ class Query(object):
|
|||
elif callable(value):
|
||||
warnings.warn(
|
||||
"Passing callable arguments to queryset is deprecated.",
|
||||
PendingDeprecationWarning, stacklevel=2)
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
value = value()
|
||||
elif isinstance(value, ExpressionNode):
|
||||
# If value is a query expression, evaluate it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue