Changes between Initial Version and Version 3 of Ticket #33864


Ignore:
Timestamp:
Jul 23, 2022, 4:41:38 AM (2 years ago)
Author:
Nick Pope
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33864

    • Property Has patch set
    • Property Triage Stage UnreviewedAccepted
  • Ticket #33864 – Description

    initial v3  
    1 The `length_is` template filter is a vestige from the days of the `{% ifequal %}` and `{% ifnotequal %}` days 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.
     1The `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.
    22
    33It 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:
Back to Top