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