From ff419de263138e905dff44c5cb806310c70f32aa Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 31 Dec 2016 08:35:39 -0500 Subject: [PATCH] Refs #25466 -- Removed aliases for LoaderOrigin and StringOrigin. Per deprecation timeline. --- django/template/__init__.py | 3 +-- django/template/base.py | 9 +-------- django/template/loader.py | 9 --------- docs/releases/2.0.txt | 4 ++++ 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/django/template/__init__.py b/django/template/__init__.py index 9cf25754f8e..b55b4491c69 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -58,8 +58,7 @@ from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA i # Template parts from .base import ( # NOQA isort:skip - Context, Node, NodeList, Origin, RequestContext, StringOrigin, Template, - Variable, + Context, Node, NodeList, Origin, RequestContext, Template, Variable, ) # Library management diff --git a/django/template/base.py b/django/template/base.py index afdf49cc0e9..dd604db2358 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -60,9 +60,7 @@ from django.template.context import ( # NOQA: imported for backwards compatibil BaseContext, Context, ContextPopException, RequestContext, ) from django.utils import six -from django.utils.deprecation import ( - DeprecationInstanceCheck, RemovedInDjango20Warning, -) +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import ( force_str, force_text, python_2_unicode_compatible, ) @@ -163,11 +161,6 @@ class Origin(object): ) -class StringOrigin(six.with_metaclass(DeprecationInstanceCheck, Origin)): - alternative = 'django.template.Origin' - deprecation_warning = RemovedInDjango20Warning - - class Template(object): def __init__(self, template_string, origin=None, name=None, engine=None): try: diff --git a/django/template/loader.py b/django/template/loader.py index 44d5332b92e..17b278812b5 100644 --- a/django/template/loader.py +++ b/django/template/loader.py @@ -1,10 +1,6 @@ from django.utils import six -from django.utils.deprecation import ( - DeprecationInstanceCheck, RemovedInDjango20Warning, -) from . import engines -from .base import Origin from .exceptions import TemplateDoesNotExist @@ -70,8 +66,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 LoaderOrigin(six.with_metaclass(DeprecationInstanceCheck, Origin)): - alternative = 'django.template.Origin' - deprecation_warning = RemovedInDjango20Warning diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index 13a47840c37..5a57c228991 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -315,3 +315,7 @@ these features. * The ``enclosure`` keyword argument to ``SyndicationFeed.add_item()`` is removed. + +* The ``django.template.loader.LoaderOrigin`` and + ``django.template.base.StringOrigin`` aliases for + ``django.template.base.Origin`` are removed.