Opened 18 years ago
Closed 18 years ago
#4023 closed (wontfix)
add a note about "get_foo_display" in template documentation
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | dev |
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 |
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 by , 18 years ago
comment:2 by , 18 years ago
Triage Stage: | Unreviewed → 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 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → 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.
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.