Opened 12 years ago

Closed 12 years ago

#19244 closed Uncategorized (fixed)

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

Reported by: Daniel Greenfeld Owned by: Daniel Greenfeld
Component: Documentation Version: dev
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

Change History (6)

comment:1 by Daniel Greenfeld, 12 years ago

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' boolean 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.
Last edited 12 years ago by Daniel Greenfeld (previous) (diff)

comment:2 by Julien Phalip, 12 years ago

Triage Stage: UnreviewedAccepted

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

comment:3 by Daniel Greenfeld, 12 years ago

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

comment:4 by Daniel Greenfeld, 12 years ago

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 by Aymeric Augustin, 12 years ago

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

comment:6 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

Resolution: fixed
Status: newclosed

In e27a43cc54f120c49cac33b36568b128bcfaef5a:

Merge pull request #509 from pydanny/ticket_19244

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

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