﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33864	Deprecate length_is template filter in favor of length.	Nick Pope	Nick Pope	"The `length_is` template filter is a vestige from the days of the `{% ifequal %}` and `{% ifnotequal %}` tags before `{% if %}` arrived with support for comparison with operators. Even the example in the documentation (see [https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#length-is here]) is poor: `{{ value|length_is:""4"" }}` will only return one of three possible values - `True`, `False`, or `""""`, the empty string being for errors in the provided values.

It seems to me that it would be better to encourage use of the `length` template filter with the `{% if %}` template tag which can provide more flexibility:

{{{#!django
{# Before: #}
{% if value|length_is:""4"" %}...{% endif %}
{{ value|length_is:""4"" }} ← This is of dubious use given the restricted set of possible output values.

{# After: #}
{% if value|length == 4 %}...{% endif %}
{% if value|length == 4 %}True{% else %}False{% endif %} ← Much clearer but also allows customising the output values.
}}}"	Cleanup/optimization	closed	Template system	dev	Normal	fixed	length_is, length, template, filter		Ready for checkin	1	0	0	0	0	0
