﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1105	[patch] simple_tag decorator enhancement	django@…	Julien Phalip	"Attached is a patch for a tag function decorator that I find useful.  It's a simple extension of Robert's simple_tag.  The tag function is passed the context as the first argument and also any arguments to the tag, resolved in the same way as for the simple_tag decorator.  The decorated function can manipulate the context and either return a string, which will be inserted into the template, or None.

For example, this tag puts the project settings into the context:

{{{
@register.simple_tag_with_context
def get_settings(context):

    """"""
    Put the project settings into the context.

    Usage::

        {% get_settings %}
    """"""

    from django.conf import settings
    context['settings'] = settings
}}}

And this one is the equivalent of the existing simple_tag example in NewAdminChanges:
{{{
@register.simple_tag_with_context
def monkey_tag(context, verb):
    return ""I %s no evil"" % verb
}}}"	defect	closed	Template system		normal	duplicate		django@… semenov@…	Design decision needed	1	1	1	1	0	0
