Add takes_context parameter to simple_tag decorator
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/
Cc: |
Craig de Stigter added
|
Owner: |
changed from nobody to Julien Phalip
|
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.