Loading django/template/__init__.py +2 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA i # Template parts from .base import ( # NOQA isort:skip Context, Node, NodeList, Origin, RequestContext, Template, Variable, Context, Node, NodeList, Origin, RequestContext, StringOrigin, Template, Variable, ) # Library management Loading django/template/base.py +8 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ 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.encoding import ( force_str, force_text, python_2_unicode_compatible, ) Loading Loading @@ -156,6 +159,11 @@ 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: Loading django/template/loader.py +11 −0 Original line number Diff line number Diff line from django.utils import six from django.utils.deprecation import ( DeprecationInstanceCheck, RemovedInDjango20Warning, ) from . import engines from .base import Origin from .exceptions import TemplateDoesNotExist Loading Loading @@ -57,3 +63,8 @@ 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 django/utils/deprecation.py +11 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ class RemovedInDjango20Warning(PendingDeprecationWarning): pass RemovedInNextVersionWarning = DeprecationWarning class RemovedInNextVersionWarning(DeprecationWarning): pass class warn_about_renamed_method(object): Loading Loading @@ -69,3 +70,12 @@ class RenameMethodsBase(type): setattr(base, old_method_name, wrapper(new_method)) return new_class class DeprecationInstanceCheck(type): def __instancecheck__(self, instance): warnings.warn( "`%s` is deprecated, use `%s` instead." % (self.__name__, self.alternative), self.deprecation_warning, 2 ) return super(DeprecationInstanceCheck, self).__instancecheck__(instance) docs/internals/deprecation.txt +4 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,10 @@ details on these changes. * The ``enclosure`` keyword argument to ``SyndicationFeed.add_item()`` will be removed. * The ``django.template.loader.LoaderOrigin`` and ``django.template.base.StringOrigin`` aliases for ``django.template.base.Origin`` will be removed. .. _deprecation-removed-in-1.10: 1.10 Loading Loading
django/template/__init__.py +2 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA i # Template parts from .base import ( # NOQA isort:skip Context, Node, NodeList, Origin, RequestContext, Template, Variable, Context, Node, NodeList, Origin, RequestContext, StringOrigin, Template, Variable, ) # Library management Loading
django/template/base.py +8 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ 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.encoding import ( force_str, force_text, python_2_unicode_compatible, ) Loading Loading @@ -156,6 +159,11 @@ 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: Loading
django/template/loader.py +11 −0 Original line number Diff line number Diff line from django.utils import six from django.utils.deprecation import ( DeprecationInstanceCheck, RemovedInDjango20Warning, ) from . import engines from .base import Origin from .exceptions import TemplateDoesNotExist Loading Loading @@ -57,3 +63,8 @@ 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
django/utils/deprecation.py +11 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ class RemovedInDjango20Warning(PendingDeprecationWarning): pass RemovedInNextVersionWarning = DeprecationWarning class RemovedInNextVersionWarning(DeprecationWarning): pass class warn_about_renamed_method(object): Loading Loading @@ -69,3 +70,12 @@ class RenameMethodsBase(type): setattr(base, old_method_name, wrapper(new_method)) return new_class class DeprecationInstanceCheck(type): def __instancecheck__(self, instance): warnings.warn( "`%s` is deprecated, use `%s` instead." % (self.__name__, self.alternative), self.deprecation_warning, 2 ) return super(DeprecationInstanceCheck, self).__instancecheck__(instance)
docs/internals/deprecation.txt +4 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,10 @@ details on these changes. * The ``enclosure`` keyword argument to ``SyndicationFeed.add_item()`` will be removed. * The ``django.template.loader.LoaderOrigin`` and ``django.template.base.StringOrigin`` aliases for ``django.template.base.Origin`` will be removed. .. _deprecation-removed-in-1.10: 1.10 Loading