Opened 12 years ago

Closed 12 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: no UI/UX: no


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 12 years ago by James Bennett

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 12 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedAccepted

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 12 years ago by Jacob

Resolution: wontfix
Status: newclosed

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