Opened 12 years ago
Closed 10 years ago
#20435 closed Cleanup/optimization (fixed)
Reorder template tag documentation.
Reported by: | jonathanslenders | Owned by: | Daniel Roseman |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | timograham@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Right now, the documentation for creation of custom template tags, using a (parser, token)-function, is mentioned above the creation of simple template tags.
It would be great to revert this order, and make clear that when possible a simple tag is recommended. (Not only for readability.)
Why?:
The ability of creating custom template tags using (parser, token) is great, but it's a lot harder or impossible to predict the behaviour or the change the template render engine if we ever have to in the future. Making sure that people are using as much as possible the built-in Node classes, would do for a nice abstract syntax tree in moste cases.
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/
See this ticket #20434 for related info.
Change History (8)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | → master |
comment:2 by , 12 years ago
I definitely agree. We should encourage people to put far more logic into template tags and filters than in the templates themselves. Having the most complicated approach being mentioned first, doesn't help.
comment:3 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 12 years ago
https://github.com/django/django/pull/1125
Basically I broke the whole tags section up into "Simple" and "Advanced", placing the simple stuff first.
comment:5 by , 11 years ago
Cc: | added |
---|---|
Has patch: | set |
Patch needs improvement: | set |
Existing pull request doesn't merge cleanly due to some recent commits.
comment:6 by , 10 years ago
Owner: | changed from | to
---|
New pull request: https://github.com/django/django/pull/3522
comment:7 by , 10 years ago
Patch needs improvement: | unset |
---|
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
That proposal makes sense to me.