Opened 13 years ago

Closed 13 years ago

#17179 closed Cleanup/optimization (fixed)

yesno arg is optional

Reported by: CarlFK Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

"Given a string mapping values for true, false and (optionally) None, returns one of those strings according to the value:"
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#yesno

Looking at the code, I see the string is optional.

if arg is None:

arg = ugettext('yes,no,maybe')

http://code.djangoproject.com/svn/django/trunk/django/template/defaultfilters.py

Attachments (1)

17179.diff (978 bytes ) - added by Calvin Spealman 13 years ago.
yesno docs now explain the argument is optional, and the default

Download all attachments as: .zip

Change History (3)

comment:1 by Julien Phalip, 13 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Accepted. The documentation could be improved by noting that if no argument is provided then the default is "yes,no,maybe".

by Calvin Spealman, 13 years ago

Attachment: 17179.diff added

yesno docs now explain the argument is optional, and the default

comment:2 by Karen Tracey, 13 years ago

Resolution: fixed
Status: newclosed

In [17086]:

Fix #17179: Document that yesno filter's default argument is "yes,no,maybe". Thanks CarlFK and calvinspealman.

Note: See TracTickets for help on using tickets.
Back to Top