Emulate Django's Template.origin attribute. Fixes incompatibility with
django-debug-toolbar. Closes #15.
This commit is contained in:
parent
6f8131af3d
commit
887001b8f9
|
@ -53,6 +53,11 @@ class Template(_Jinja2Template):
|
||||||
signals.template_rendered.send(sender=self, template=self, context=Context(context))
|
signals.template_rendered.send(sender=self, template=self, context=Context(context))
|
||||||
return super(Template, self).render(**context)
|
return super(Template, self).render(**context)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def origin(self):
|
||||||
|
return Origin(self.filename)
|
||||||
|
|
||||||
|
|
||||||
def dict_from_django_context(context):
|
def dict_from_django_context(context):
|
||||||
"""Flattens a Django :class:`django.template.context.Context` object.
|
"""Flattens a Django :class:`django.template.context.Context` object.
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue