Code

#19244 closed Uncategorized (fixed)

Provide the missing examples from the "Built-in template tags and filters" page

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

Description

Any template tag or filter that doesn't reference another page should have at least one example. Missing examples include:

  • comment
  • debug
  • ifnotequal (is this one necessary?)
  • templatetag
  • dictsortreversed (is this one necessary?)
  • escape
  • force_escape
  • pprint
  • timesince
  • timeuntil

Attachments (0)

Change History (6)

comment:1 Changed 20 months ago by pydanny

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The following won't be included in my patch:

  • debug is such a special case I'm not including it in this ticket anymore.
  • ifnotequal should not be documented, just so that people are encouraged more to use the '!=' and 'is not' operators.
  • dictsortreversed is not being covered as the story is too simple to require an example.
  • As pprint is supposed to "Prints the formatted representation of object on stream, followed by a newline" and doesn't seem to actually do that when I try it, I suspect this filter is broken. May open a separate ticket on it.
Version 0, edited 20 months ago by pydanny (next)

comment:2 Changed 20 months ago by julien

  • Triage Stage changed from Unreviewed to Accepted

Great idea! Please do open a ticket for pprint if you find an issue with it. Thanks!

comment:3 Changed 20 months ago by pydanny

Pull request submitted! See https://github.com/django/django/pull/509

comment:4 Changed 20 months ago by pydanny

Just confirmed that pprint does work but it's hard to come up with a good, terse example. Leaving it off for the same reason I'm leaving off debug. It's too special of a case.

comment:5 Changed 20 months ago by aaugustin

The pull request looks good, I've left only a small comment.

comment:6 Changed 20 months ago by Aymeric Augustin <aymeric.augustin@…>

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

In e27a43cc54f120c49cac33b36568b128bcfaef5a:

Merge pull request #509 from pydanny/ticket_19244

Fixed #19244 -- Provided examples for some built-in templatetags and filters

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.