1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #33864 -- Deprecated length_is template filter.

This commit is contained in:
Nick Pope
2021-04-22 16:55:59 +01:00
committed by Mariusz Felisiak
parent 2fac0a1808
commit 4d4bf55e0e
6 changed files with 48 additions and 5 deletions

View File

@@ -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 }}