summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2013-12-18 16:59:08 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2013-12-18 18:40:00 +0100
commitf1b3ab9c2158f5a7da113aef4158499ce2d42ee2 (patch)
tree38fdbbafde8008a26d6ef559e25a18c69afee958 /django
parentd34c8c338a843df2a540f19d15efc1ff12e3119c (diff)
Fixed #11629 -- Deprecated callable arguments to queryset methods.
Callable arguments were an untested and undocumented feature.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/sql/query.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 223e516d56..c3c8e55793 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -9,6 +9,7 @@ all about the internals of models in order to get the information it needs.
from collections import OrderedDict
import copy
+import warnings
from django.utils.encoding import force_text
from django.utils.tree import Node
@@ -1036,6 +1037,9 @@ class Query(object):
lookup_type = 'isnull'
value = True
elif callable(value):
+ warnings.warn(
+ "Passing callable arguments to queryset is deprecated.",
+ PendingDeprecationWarning, stacklevel=2)
value = value()
elif isinstance(value, ExpressionNode):
# If value is a query expression, evaluate it