{{{#!python
{% empty %}
<li>Sorry, no athlete in this list!</li>
{% endfor %}
}}}
{{{#!python
{% else %}
<li>Sorry, no athletes in this list.</li>
{% endif %}
}}}
We might keep the second version I think.
[https://docs.djangoproject.com/en/def/ref/templates/builtins/#for-empty]
--
Ticket URL: <https://code.djangoproject.com/ticket/20606>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
The plural form is the correct one.
As for the exclamation mark, I'm fine either way.
--
Ticket URL: <https://code.djangoproject.com/ticket/20606#comment:1>
Old description:
> There is two different versions of code that should be equivalent, but
> there are two differences, which are a **plural** and an **exclamation
> mark**.
>
> {{{#!python
> {% empty %}
> <li>Sorry, no athlete in this list!</li>
> {% endfor %}
> }}}
>
> {{{#!python
> {% else %}
> <li>Sorry, no athletes in this list.</li>
> {% endif %}
> }}}
>
> We might keep the second version I think.
>
> [https://docs.djangoproject.com/en/def/ref/templates/builtins/#for-empty]
New description:
There is two different versions of code that should be equivalent, but
there are two differences, which are a **plural** and an **exclamation
mark**.
{{{#!python
{% empty %}
<li>Sorry, no athlete in this list!</li>
{% endfor %}
}}}
{{{#!python
{% else %}
<li>Sorry, no athletes in this list.</li>
{% endif %}
}}}
We might keep the second version I think.
[https://docs.djangoproject.com/en/dev/ref/templates/builtins/#for-empty]
--
--
Ticket URL: <https://code.djangoproject.com/ticket/20606#comment:2>
* owner: nobody => batisteo
* cc: baptiste+django-code@… (added)
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/20606#comment:3>
* owner: batisteo =>
* status: assigned => new
Comment:
Fixed in bf9975b0eb5f839ac5ff53b4fb302548dde6a418 by claudep
--
Ticket URL: <https://code.djangoproject.com/ticket/20606#comment:4>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/20606#comment:5>