diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 2 | ||||
| -rw-r--r-- | docs/ref/templates/builtins.txt | 2 | ||||
| -rw-r--r-- | docs/releases/4.2.txt | 15 |
3 files changed, 19 insertions, 0 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 160605ddcd..43c7a0fee9 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -22,6 +22,8 @@ details on these changes. * The ``AlterIndexTogether`` migration operation will be removed. A stub operation will remain for compatibility with historical migrations. +* The ``length_is`` template filter will be removed. + .. _deprecation-removed-in-5.0: 5.0 diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index c4b83a8be8..13a8694ad6 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1906,6 +1906,8 @@ The filter returns ``0`` for an undefined variable. ``length_is`` ------------- +.. deprecated:: 4.2 + Returns ``True`` if the value's length is the argument, or ``False`` otherwise. For example:: diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index 413e9a9471..0846f05e2c 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -317,3 +317,18 @@ Miscellaneous for using Python's :py:mod:`secrets` module to generate passwords. * The ``AlterIndexTogether`` migration operation is deprecated. + +* The ``length_is`` template filter is deprecated in favor of :tfilter:`length` + and the ``==`` operator within an :ttag:`{% if %}<if>` tag. For example + + .. code-block:: html+django + + {% if value|length == 4 %}…{% endif %} + {% if value|length == 4 %}True{% else %}False{% endif %} + + instead of: + + .. code-block:: html+django + + {% if value|length_is:4 %}…{% endif %} + {{ value|length_is:4 }} |
