#10545 closed (fixed)
Developing custom tag - setting context is missing a limitation
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | custom template tags | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the documentation of SETTING A VARIABLE IN THE CONTEXT (http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#setting-a-variable-in-the-context) it is not mentioned that any variable set to the context will only be available in the same BLOCK part of the template in which it was assigned.
This limitation needs to be mentioned in the docs and hopefully solved in a future version.
Attachments (1)
Change History (5)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 15 years ago
Attachment: | 10545.diff added |
---|
comment:2 by , 15 years ago
Has patch: | set |
---|
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 14 years ago
Note:
See TracTickets
for help on using tickets.
It should certainly be mentioned, you're right about. However the behaviour is intentional. It provides a scope for the variables so that they don't clash with other things. Yes, I realise there are cases where people sometimes want a more extensive visibility scope, so no need to post that you have such a case. We have scoping, though, and it's relied upon in a lot of places, so I wouldn't expect it to change.