On Wed, 2008-02-27 at 21:58 -0800, Julien wrote:
> Hi,
>
> I would like to access the context from simple tag, like this:
>
> @register.simple_tag(takes_context=True)
> def my_tag(context):
> whatever = resolve_variable('whatever', context)
> return 'blabla'
>
> But that doesn't work, I get the error: "simple_tag() got an
> unexpected keyword argument 'takes_context'"
>
> Is takes_context only for inclusion tags?
That is correct. One day we'll add support for simple tag. In the
meantime, it's not that difficult to just write a quick tag without
using the shortcut. See the examples in django/templates/defaulttags.py
Regards,
maclolm
--
I don't have a solution, but I admire your problem.
http://www.pointy-stick.com/blog/