summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-11-07 18:19:34 -0500
committerTim Graham <timograham@gmail.com>2017-01-17 14:09:28 -0500
commitf032bbc8b107ab9274542f8d233fc88aa1c6e04d (patch)
tree4113c993f2d0018bfd3cc23d656a2ecd981d5149 /docs
parent742d666da57b52a3b00aa9b1c527ece829e95245 (diff)
Refs #18651 -- Removed assignment_tag per deprecation timeline.
Diffstat (limited to 'docs')
-rw-r--r--docs/howto/custom-template-tags.txt29
-rw-r--r--docs/releases/1.9.txt5
-rw-r--r--docs/releases/2.0.txt2
3 files changed, 4 insertions, 32 deletions
diff --git a/docs/howto/custom-template-tags.txt b/docs/howto/custom-template-tags.txt
index 53ea433137..448576784f 100644
--- a/docs/howto/custom-template-tags.txt
+++ b/docs/howto/custom-template-tags.txt
@@ -629,35 +629,6 @@ positional arguments. For example:
{% my_tag 123 "abcd" book.title warning=message|lower profile=user.profile %}
-Assignment tags
----------------
-
-.. method:: django.template.Library.assignment_tag()
-
-.. deprecated:: 1.9
-
- ``simple_tag`` can now store results in a template variable and should
- be used instead.
-
-To ease the creation of tags setting a variable in the context, Django provides
-a helper function, ``assignment_tag``. This function works the same way as
-:meth:`~django.template.Library.simple_tag` except that it stores the tag's
-result in a specified context variable instead of directly outputting it.
-
-Our earlier ``current_time`` function could thus be written like this::
-
- @register.assignment_tag
- def get_current_time(format_string):
- return datetime.datetime.now().strftime(format_string)
-
-You may then store the result in a template variable using the ``as`` argument
-followed by the variable name, and output it yourself where you see fit:
-
-.. code-block:: html+django
-
- {% get_current_time "%Y-%m-%d %I:%M %p" as the_time %}
- <p>The time is {{ the_time }}.</p>
-
Advanced custom template tags
-----------------------------
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt
index adcd6c949b..b7b489499d 100644
--- a/docs/releases/1.9.txt
+++ b/docs/releases/1.9.txt
@@ -938,9 +938,8 @@ define built-in libraries via the ``'builtins'`` key of :setting:`OPTIONS
In general, template tags do not autoescape their contents, and this behavior is
:ref:`documented <tags-auto-escaping>`. For tags like
:class:`~django.template.Library.inclusion_tag`, this is not a problem because
-the included template will perform autoescaping. For
-:class:`~django.template.Library.assignment_tag`, the output will be escaped
-when it is used as a variable in the template.
+the included template will perform autoescaping. For ``assignment_tag()``,
+the output will be escaped when it is used as a variable in the template.
For the intended use cases of :class:`~django.template.Library.simple_tag`,
however, it is very easy to end up with incorrect HTML and possibly an XSS
diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt
index 97e59ca26f..751b46cccf 100644
--- a/docs/releases/2.0.txt
+++ b/docs/releases/2.0.txt
@@ -241,3 +241,5 @@ these features.
is removed.
* The ``django.forms.extras`` package is removed.
+
+* The ``assignment_tag`` helper is removed.