Advanced pending deprecation warnings.

Also added stacklevel argument, fixed #18127.
This commit is contained in:
Aymeric Augustin 2012-12-25 21:07:27 +01:00
parent 130829334c
commit ef017a5f00
12 changed files with 24 additions and 23 deletions

View file

@ -703,7 +703,7 @@ class QuerySet(object):
"""
if 'depth' in kwargs:
warnings.warn('The "depth" keyword argument has been deprecated.\n'
'Use related field names instead.', PendingDeprecationWarning)
'Use related field names instead.', DeprecationWarning, stacklevel=2)
depth = kwargs.pop('depth', 0)
if kwargs:
raise TypeError('Unexpected keyword arguments to select_related: %s'