magic-removal: fixed old imports of django.core.template_loader
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
58c97d9884
commit
5a54e18f9b
|
@ -1,5 +1,5 @@
|
|||
from django import template
|
||||
from djang.core import template_loader
|
||||
from django.template import loader
|
||||
from django.utils.html import escape
|
||||
from django.utils.text import capfirst
|
||||
from django.utils.functional import curry
|
||||
|
@ -72,14 +72,14 @@ class FieldWidgetNode(template.Node):
|
|||
field_class_name = klass.__name__
|
||||
template_name = "widget/%s" % \
|
||||
class_name_to_underscored(field_class_name)
|
||||
nodelist = template_loader.get_template(template_name).nodelist
|
||||
nodelist = loader.get_template(template_name).nodelist
|
||||
except template.TemplateDoesNotExist:
|
||||
super_klass = bool(klass.__bases__) and klass.__bases__[0] or None
|
||||
if super_klass and super_klass != Field:
|
||||
nodelist = cls.get_nodelist(super_klass)
|
||||
else:
|
||||
if not cls.default:
|
||||
cls.default = template_loader.get_template("widget/default").nodelist
|
||||
cls.default = loader.get_template("widget/default").nodelist
|
||||
nodelist = cls.default
|
||||
|
||||
cls.nodelists[klass] = nodelist
|
||||
|
@ -169,7 +169,7 @@ class EditInlineNode(template.Node):
|
|||
bound_related_object = relation.bind(context['form'], original, bound_related_object_class)
|
||||
context['bound_related_object'] = bound_related_object
|
||||
|
||||
t = template_loader.get_template(bound_related_object.template_name())
|
||||
t = loader.get_template(bound_related_object.template_name())
|
||||
|
||||
output = t.render(context)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.contrib.flatpages.models import FlatPage
|
||||
from django.core import template_loader
|
||||
from django.template import loader
|
||||
from django.core.extensions import get_object_or_404, DjangoContext
|
||||
from django.http import HttpResponse
|
||||
from django.conf.settings import SITE_ID
|
||||
|
@ -26,9 +26,9 @@ def flatpage(request, url):
|
|||
from django.views.auth.login import redirect_to_login
|
||||
return redirect_to_login(request.path)
|
||||
if f.template_name:
|
||||
t = template_loader.select_template((f.template_name, DEFAULT_TEMPLATE))
|
||||
t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))
|
||||
else:
|
||||
t = template_loader.get_template(DEFAULT_TEMPLATE)
|
||||
t = loader.get_template(DEFAULT_TEMPLATE)
|
||||
c = DjangoContext(request, {
|
||||
'flatpage': f,
|
||||
})
|
||||
|
|
|
@ -882,7 +882,7 @@ class Library(object):
|
|||
dict = func(*args)
|
||||
|
||||
if not getattr(self, 'nodelist', False):
|
||||
from django.core.template_loader import get_template
|
||||
from django.template.loader import get_template
|
||||
t = get_template(file_name)
|
||||
self.nodelist = t.nodelist
|
||||
return self.nodelist.render(context_class(dict))
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
import urllib
|
||||
import posixpath
|
||||
import mimetypes
|
||||
from django.core import template_loader
|
||||
from django.template import loader
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.template import Template, Context, TemplateDoesNotExist
|
||||
|
@ -71,7 +71,7 @@ DEFAULT_DIRECTORY_INDEX_TEMPLATE = """
|
|||
|
||||
def directory_index(path, fullpath):
|
||||
try:
|
||||
t = template_loader.get_template('static/directory_index')
|
||||
t = loader.get_template('static/directory_index')
|
||||
except TemplateDoesNotExist:
|
||||
t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE)
|
||||
files = []
|
||||
|
|
Loading…
Reference in New Issue