#25732 closed Cleanup/optimization (fixed)
Update "Don’t invent a programming language" section Design Philosophies doc
Reported by: | Neal Todd | Owned by: | Neal Todd |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | neal@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The "Don’t invent a programming language" section in Design philosophies states:
The template system intentionally doesn’t allow ... Assignment to variables
However, the 1.9 release adds support for this via the simple_tag:
Template tags created with the simple_tag() helper can now store results in a template variable by using the as argument.
The docs need to be made consistent, at least by removing that specific statement. I haven't included a PR on this as it may be the case that a more through rewrite of this section is due. It also states that "Advanced logic" isn't allowed either. With the various additional features in Templates in the last few versions, including jinja2 support that might be stretching the assertion a bit far now. True, it's not advanced compared to what can be done in Python, but the logic control is quite sophisticated.
Maybe just removing the first line and the two bullet points is enough? If so, I can submit a PR.
NB: this is referenced here:
https://code.djangoproject.com/ticket/6378#comment:24
(an old open ticket that looks like it can be closed as a result of the single_tag update).
Change History (4)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Cc: | added |
---|---|
Has patch: | set |
Owner: | changed from | to
Status: | new → assigned |
I guess we could make a distinction between "Template system" and the "Django Template Language (DTL)" which I think still mostly aims to avoid "Advanced logic". Feel free to submit a PR.