Django

Code

Ticket #4023 (closed: wontfix)

Opened 3 years ago

Last modified 3 years ago

add a note about "get_foo_display" in template documentation

Reported by: hotani@gmail.com Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords: templates get_foo_display
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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 }}

Attachments

Change History

04/12/07 13:08:26 changed by ubernostrum

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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.

04/13/07 13:42:30 changed by Gary Wilson <gary.wilson@gmail.com>

  • 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.

06/07/07 13:19:47 changed by jacob

  • status changed from new to closed.
  • resolution set to wontfix.

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.


Add/Change #4023 (add a note about "get_foo_display" in template documentation)




Change Properties
Action