Skip to content

Commit

Permalink
Merge remote-tracking branch 'coffin/master'
Browse files Browse the repository at this point in the history
Conflicts:
	coffin/common.py
	tests/res/apps/templatelibs_app/templatetags/foo_ext.py
  • Loading branch information
miracle2k committed May 3, 2011
2 parents 060281d + 044351b commit 6f8131a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion coffin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


__all__ = ('__version__', '__build__', '__docformat__', 'get_revision')
__version__ = (0, 3, 3)
__version__ = (0, 3, 4)
__docformat__ = 'restructuredtext en'

import os
Expand Down
1 change: 1 addition & 0 deletions coffin/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def from_setting(setting):
# Finally, add extensions defined in application's templatetag libraries
for lib in self._get_templatelibs():
_load_lib(lib)
attrs.update(getattr(lib, 'jinja2_environment_attrs', {}))

return dict(
extensions=extensions,
Expand Down
5 changes: 3 additions & 2 deletions coffin/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
# Merge with ``django.template``.
from django.template import __all__
from django.template import *
from django.test import signals

# Override default library class with ours
from library import *


class Template(_Jinja2Template):
'''Fixes the incompabilites between Jinja2's template class and
Django's.
Expand Down Expand Up @@ -49,9 +49,10 @@ def render(self, context=None):
else:
context = dict_from_django_context(context)
assert isinstance(context, dict) # Required for **-operator.
# It'd be nice to move this only into the test env
signals.template_rendered.send(sender=self, template=self, context=Context(context))
return super(Template, self).render(**context)


def dict_from_django_context(context):
"""Flattens a Django :class:`django.template.context.Context` object.
"""
Expand Down

0 comments on commit 6f8131a

Please sign in to comment.