Code

Opened 3 years ago

Closed 3 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 calvinspealman 3 years ago.
yesno docs now explain the argument is optional, and the default

Download all attachments as: .zip

Change History (3)

comment:1 Changed 3 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

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

Changed 3 years ago by calvinspealman

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

comment:2 Changed 3 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from new to closed

In [17086]:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.