Skip to content

Commit

Permalink
Removed template.loader.BaseLoader per deprecation timeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Sep 23, 2015
1 parent 2a20ebe commit 4811f09
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 36 deletions.
14 changes: 1 addition & 13 deletions django/template/engine.py
@@ -1,8 +1,5 @@
import warnings

from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string

Expand Down Expand Up @@ -122,16 +119,7 @@ def find_template_loader(self, loader):

if isinstance(loader, six.string_types):
loader_class = import_string(loader)

if getattr(loader_class, '_accepts_engine_in_init', False):
args.insert(0, self)
else:
warnings.warn(
"%s inherits from django.template.loader.BaseLoader "
"instead of django.template.loaders.base.Loader. " %
loader, RemovedInDjango110Warning, stacklevel=2)

return loader_class(*args)
return loader_class(self, *args)
else:
raise ImproperlyConfigured(
"Invalid value in template loaders configuration: %r" % loader)
Expand Down
16 changes: 0 additions & 16 deletions django/template/loader.py
@@ -1,10 +1,5 @@
import warnings

from django.utils.deprecation import RemovedInDjango110Warning

from . import engines
from .exceptions import TemplateDoesNotExist
from .loaders import base


def get_template(template_name, using=None):
Expand Down Expand Up @@ -62,14 +57,3 @@ def render_to_string(template_name, context=None, request=None, using=None):

def _engine_list(using=None):
return engines.all() if using is None else [engines[using]]


class BaseLoader(base.Loader):
_accepts_engine_in_init = False

def __init__(self, *args, **kwargs):
warnings.warn(
"django.template.loader.BaseLoader was superseded by "
"django.template.loaders.base.Loader.",
RemovedInDjango110Warning, stacklevel=2)
super(BaseLoader, self).__init__(*args, **kwargs)
2 changes: 0 additions & 2 deletions django/template/loaders/base.py
Expand Up @@ -6,8 +6,6 @@


class Loader(object):
# Only used to raise a deprecation warning. Remove in Django 1.10.
_accepts_engine_in_init = True

def __init__(self, engine):
self.engine = engine
Expand Down
5 changes: 0 additions & 5 deletions docs/ref/templates/api.txt
Expand Up @@ -968,11 +968,6 @@ loaders. Custom ``Loader`` classes should inherit from
``django.template.loaders.base.Loader`` and define the ``get_contents()`` and
``get_template_sources()`` methods.

.. versionchanged:: 1.8

``django.template.loaders.base.Loader`` used to be defined at
``django.template.loader.BaseLoader``.

.. versionchanged:: 1.9

In previous versions of Django, custom loaders defined a single method:
Expand Down

0 comments on commit 4811f09

Please sign in to comment.