Permalink
Browse files

Fixed #22933 -- Deprecated django.template.resolve_variable().

  • Loading branch information...
timgraham committed Jul 1, 2014
1 parent 232f202 commit 20ec9daf7c2a4460e99a2983d7e32b7db5ee7ce6
Showing with 14 additions and 0 deletions.
  1. +5 −0 django/template/base.py
  2. +2 −0 docs/internals/deprecation.txt
  3. +7 −0 docs/releases/1.8.txt
View
@@ -4,11 +4,13 @@
from functools import partial
from importlib import import_module
from inspect import getargspec, getcallargs
+import warnings
from django.apps import apps
from django.conf import settings
from django.template.context import (BaseContext, Context, RequestContext, # NOQA: imported for backwards compatibility
ContextPopException)
+from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.itercompat import is_iterable
from django.utils.text import (smart_split, unescape_string_literal,
get_text_list)
@@ -658,6 +660,9 @@ def resolve_variable(path, context):
Deprecated; use the Variable class instead.
"""
+ warnings.warn("resolve_variable() is deprecated. Use django.template."
+ "Variable(path).resolve(context) instead",
+ RemovedInDjango20Warning, stacklevel=2)
return Variable(path).resolve(context)
@@ -42,6 +42,8 @@ about each item can often be found in the release notes of two versions prior.
:class:`~django.core.management.BaseCommand` instead, which takes no arguments
by default.
+* ``django.template.resolve_variable`` will be removed.
+
.. _deprecation-removed-in-1.9:
1.9
View
@@ -525,3 +525,10 @@ instead, which takes no arguments by default.
option ``cache_choices``. This cached querysets between multiple renderings of
the same ``Form`` object. This option is subject to an accelerated deprecation
and will be removed in Django 1.9.
+
+``django.template.resolve_variable()``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The function has been informally marked as "Deprecated" for some time. Replace
+``resolve_variable(path, context)`` with
+``django.template.Variable(path).resolve(context)``.

0 comments on commit 20ec9da

Please sign in to comment.