Emulate Django's Template.origin attribute. Fixes incompatibility with

django-debug-toolbar. Closes #15.
This commit is contained in:
Michael Elsdoerfer 2011-05-03 09:51:05 +02:00
parent 6f8131af3d
commit 887001b8f9
1 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,11 @@ class Template(_Jinja2Template):
signals.template_rendered.send(sender=self, template=self, context=Context(context))
return super(Template, self).render(**context)
@property
def origin(self):
return Origin(self.filename)
def dict_from_django_context(context):
"""Flattens a Django :class:`django.template.context.Context` object.
"""