Code

#20606 closed Bug (fixed)

Non equivalent code example in template tag for…empty

Reported by: batisteo Owned by:
Component: Documentation Version: master
Severity: Normal Keywords: typo
Cc: baptiste+django-code@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by claudep)

There is two different versions of code that should be equivalent, but there are two differences, which are a plural and an exclamation mark.

{% empty %}
    <li>Sorry, no athlete in this list!</li>
{% endfor %}
{% 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

Attachments (0)

Change History (5)

comment:1 Changed 13 months ago by bmispelon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

The plural form is the correct one.

As for the exclamation mark, I'm fine either way.

comment:2 Changed 13 months ago by claudep

  • Description modified (diff)

comment:3 Changed 13 months ago by batisteo

  • Cc baptiste+django-code@… added
  • Owner changed from nobody to batisteo
  • Status changed from new to assigned

comment:4 Changed 13 months ago by batisteo

  • Owner batisteo deleted
  • Status changed from assigned to new

comment:5 Changed 13 months ago by batisteo

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

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.