Opened 8 years ago

Closed 8 years ago

#4023 closed (wontfix)

add a note about "get_foo_display" in template documentation

Reported by: hotani@… Owned by: jacob
Component: Documentation Version: master
Severity: Keywords: templates get_foo_display
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

There is no mention of the function "get_foo_display" on this page of the documentation, and it seems like something a template author would need to know when dealing with a choices value. Even though I knew about the function, it took a while to find how it would be used in a template: {{ object.get_foo_display }}

Change History (3)

comment:1 Changed 8 years ago by ubernostrum

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

It's used the same way as every other function: just write out its name and be sure to leave off the parentheses ;)

On a serious note, though, I think what would be more appropriate is a "how do I take this handy function and use it in a template" section which really explains this; just picking out specific functions and saying "to use function X, do Y" could give people the impression that those are the _only_ functions you're allowed to use.

comment:2 Changed 8 years ago by Gary Wilson <gary.wilson@…>

  • Triage Stage changed from Unreviewed to Accepted

Yes, I agree we need a section in the template documentation about the fields that provide these additional functions, with a short note about how they are used. Most are mentioned on the model api page, but that is not where a template designer will be looking. Perhaps these functions should instead be listed on the template documentation page and linked to from the field sections on the model api page.

comment:3 Changed 8 years ago by jacob

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

I think it's not unreasonable to point template authors to the model docs when they're dealing with models in the template. I'm gonna WONTFIX this one.

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