[Django] #21747: The {% elif %} templatetag could use documentation

4 views
Skip to first unread message

Django

unread,
Jan 8, 2014, 11:14:32 AM1/8/14
to django-...@googlegroups.com
#21747: The {% elif %} templatetag could use documentation
-------------------------------+--------------------
Reporter: gcc | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
The [https://docs.djangoproject.com/en/dev/topics/templates/ Django
templates page] makes no mention of the {% elif %} tag, although it does
document {% if %} and {% else %}.

I was curious so I went digging in the source, and discovered that {% elif
%} is implemented. It even has doc comments:

{{{
{% if athlete_list %}
Number of athletes: {{ athlete_list|count }}
{% elif athlete_in_locker_room_list %}
Athletes should be out of the locker room soon!
{% else %}
No athletes.
{% endif %}
}}}

It would be great to have it officially documented on the Templates page.

--
Ticket URL: <https://code.djangoproject.com/ticket/21747>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 8, 2014, 11:44:42 AM1/8/14
to django-...@googlegroups.com
#21747: The {% elif %} templatetag could use documentation
--------------------------------------+------------------------------------
Reporter: gcc | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by mjtamlyn):

* needs_better_patch: => 0
* needs_docs: => 0
* type: New feature => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

The `{% elif %}` tag is documented as part of the `{% if %}` documentation
in the reference docs:
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#ref-
templates-builtins-tags

These are quite heavily linked to from the section you mention, but I
guess it wouldn't hurt to amend one of the examples there to include an
`elif`.

--
Ticket URL: <https://code.djangoproject.com/ticket/21747#comment:1>

Django

unread,
Jan 16, 2014, 7:08:58 AM1/16/14
to django-...@googlegroups.com
#21747: The {% elif %} templatetag could use documentation
--------------------------------------+------------------------------------
Reporter: gcc | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.6
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"9e5033b302676856901a7808910fcab5c3fe1d27"]:
{{{
#!CommitTicketReference repository=""
revision="9e5033b302676856901a7808910fcab5c3fe1d27"
Fixed #21747 -- Added {% elif %} to template topics guide.

Thanks gcc for the suggestion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21747#comment:2>

Django

unread,
Jan 16, 2014, 7:09:36 AM1/16/14
to django-...@googlegroups.com
#21747: The {% elif %} templatetag could use documentation
--------------------------------------+------------------------------------
Reporter: gcc | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.6

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"f8d93f2c71f5a6dff349ec290f9ca6d7d316ba4f"]:
{{{
#!CommitTicketReference repository=""
revision="f8d93f2c71f5a6dff349ec290f9ca6d7d316ba4f"
[1.6.x] Fixed #21747 -- Added {% elif %} to template topics guide.

Thanks gcc for the suggestion.

Backport of 9e5033b302 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21747#comment:3>

Reply all
Reply to author
Forward
0 new messages