From f1b3ab9c2158f5a7da113aef4158499ce2d42ee2 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Wed, 18 Dec 2013 16:59:08 +0100 Subject: Fixed #11629 -- Deprecated callable arguments to queryset methods. Callable arguments were an untested and undocumented feature. --- django/db/models/sql/query.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'django/db/models/sql') 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 -- cgit v1.3