Skip to content

Commit

Permalink
Emulate Django's Template.origin attribute. Fixes incompatibility with
Browse files Browse the repository at this point in the history
django-debug-toolbar. Closes #15.
  • Loading branch information
miracle2k committed May 3, 2011
1 parent 6f8131a commit 887001b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions coffin/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def render(self, context=None):
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.
"""
Expand Down

0 comments on commit 887001b

Please sign in to comment.