#24586: @register.inclusion_tag fails to work on decorated function
-------------------------+-------------------------------------------------
Reporter: | Owner: nobody
cjerdonek |
Type: | Status: new
Uncategorized |
Component: | Version: 1.7
Template system | Keywords: template,inclusion_tag,custom
Severity: Normal | tag,decorator
Triage Stage: | Has patch: 0
Unreviewed |
Easy pickings: 0 | UI/UX: 0
-------------------------+-------------------------------------------------
When defining custom tags, the `@register.inclusion_tag` does not seem to
work when applied to a decorated function. For example--
{{{
#!python
@register.inclusion_tag('template.html', takes_context=True)
@my_decorator
def my_tag(context, arg):
# Code
}}}
However, I found that if `name='my_tag'` is added to the `inclusion_tag()`
call, then it worked. This wasn't easy to figure out and doesn't seem to
be documented. It just silently failed with no easy way to troubleshoot.
It seems like the tag should work without needing to add the `name`
argument.
--
Ticket URL: <https://code.djangoproject.com/ticket/24586>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.a127e07cc7c1bedcaf6d1d2c3c8e0207%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.