#14908 closed (fixed)
Add takes_context parameter to simple_tag decorator
| Reported by: | Julien Phalip | Owned by: | Julien Phalip |
|---|---|---|---|
| Component: | Template system | Version: | 1.2 |
| Severity: | Keywords: | ||
| Cc: | Craig de Stigter | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
There is no "simple" way for accessing the context in a template tag. The only options are to use an inclusion_tag (which also requires the use of a template) or to create a Node/parser (which is tedious).
To address this, the consensus in (1) is to make simple_tag consistent with inclusion_tag by introducing a takes_context decorator parameter.
(1) http://groups.google.com/group/django-developers/browse_thread/thread/fbf7d9fd8f256b17/
Attachments (1)
Change History (8)
comment:1 by , 15 years ago
| Cc: | added |
|---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
| Owner: | changed from to |
|---|
julien, it's all yours. I just cc'd myself since I'm keen to see this happen; not intending to write it myself ;)
by , 15 years ago
| Attachment: | 14908_simple_tag_takes_context_r14922.diff added |
|---|
comment:5 by , 15 years ago
| Has patch: | set |
|---|
comment:6 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Whoops, I forgot to grab the ticket myself, as I was going to work on a patch tomorrow. cdestigter, happy for you to do it, though remember that a patch has to be finalised by this weekend for this to stand a chance to be included in 1.3.
You might find good pointers in the patch I've done for #1105.