~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to django/template/loader_tags.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (1.1.21) (4.4.27 sid)
  • Revision ID: package-import@ubuntu.com-20130509151047-aqv8d71oj9wvcv8c
Tags: 1.5.1-2
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
    token_kwargs, Variable
4
4
from django.template.loader import get_template
5
5
from django.utils.safestring import mark_safe
 
6
from django.utils import six
6
7
 
7
8
register = Library()
8
9
 
17
18
        self.blocks = {}
18
19
 
19
20
    def add_blocks(self, blocks):
20
 
        for name, block in blocks.iteritems():
 
21
        for name, block in six.iteritems(blocks):
21
22
            if name in self.blocks:
22
23
                self.blocks[name].insert(0, block)
23
24
            else:
130
131
 
131
132
    def render_template(self, template, context):
132
133
        values = dict([(name, var.resolve(context)) for name, var
133
 
                       in self.extra_context.iteritems()])
 
134
                       in six.iteritems(self.extra_context)])
134
135
        if self.isolated_context:
135
136
            return template.render(context.new(values))
136
137
        context.update(values)