﻿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
31024	firstof template tag documentation incorrectly specifies value testing.	Keryn Knight	Uttam Kini	"The documentation for `{%firstof x y z %}` says:

> Outputs the first argument variable that is not **False**. Outputs nothing if all the passed variables are **False**.

The emphasis not mine, and indicates it's specifically testing for the singleton False. But the example it gives as an equivalent is based on normal [https://docs.python.org/3/library/stdtypes.html#truth-value-testing truth value testing]:
{{{
{% if var1 %}
    {{ var1 }}
{% elif var2 %}
    {{ var2 }}
{% elif var3 %}
    {{ var3 }}
{% endif %}
}}}
and the [https://github.com/django/django/blob/a5855c8f0fe17b7e888bd8137874ef78012a7294/django/template/defaulttags.py#L125 code is also based on truthiness]

The documentation for how a simple `{% if ... %}` behaves meanwhile more correctly prescribes it's function related to ''""true""'' and what that means.
> evaluates a variable, and if that variable is “true” (i.e. exists, is not empty, and is not a false boolean value) the contents of the block are output

Were it actually based on **False** rather than **Falsiness**, the following would not output ''truthy''.
{{{
>>> from django.template import Template, Context
>>> context = {'a': None,'b': False,'c': 0,'d': '','e': (),'f': [],'g': {},'h': set(),'i': ""truthy""}
>>> t = Template(""{% firstof a b c d e f g h i %}"")
>>> t.render(Context(context))
'truthy'
}}}

Suggestion is to clarify that it's based on truthiness/falsiness, rather than imply it's directly based on encountering **False**.
"	Cleanup/optimization	closed	Documentation	dev	Normal	fixed			Ready for checkin	1	0	0	0	1	0
