summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-06-22 13:54:35 -0400
committerTim Graham <timograham@gmail.com>2015-06-23 07:22:16 -0400
commitae1d663b7913f6da233c55409c4973248372d302 (patch)
tree1ac06b1eccd77be127ae8d046e9ade878623c176 /django
parent7439039806038ce35d3a91f430037c667dcab051 (diff)
[1.8.x] Renamed RemovedInDjango20Warning to RemovedInDjango110Warning.
Diffstat (limited to 'django')
-rw-r--r--django/conf/__init__.py6
-rw-r--r--django/conf/urls/__init__.py10
-rw-r--r--django/conf/urls/i18n.py6
-rw-r--r--django/contrib/admin/helpers.py6
-rw-r--r--django/contrib/auth/views.py6
-rw-r--r--django/contrib/contenttypes/models.py4
-rw-r--r--django/contrib/gis/db/models/query.py12
-rw-r--r--django/contrib/gis/db/models/sql/aggregates.py2
-rw-r--r--django/contrib/webdesign/__init__.py6
-rw-r--r--django/core/context_processors.py4
-rw-r--r--django/core/files/storage.py6
-rw-r--r--django/core/management/base.py10
-rw-r--r--django/core/management/commands/migrate.py4
-rw-r--r--django/core/urlresolvers.py4
-rw-r--r--django/db/backends/base/creation.py4
-rw-r--r--django/db/models/aggregates.py2
-rw-r--r--django/db/models/fields/files.py6
-rw-r--r--django/db/models/fields/related.py4
-rw-r--r--django/db/models/fields/subclassing.py4
-rw-r--r--django/db/models/options.py8
-rw-r--r--django/db/models/sql/aggregates.py4
-rw-r--r--django/db/models/sql/compiler.py4
-rw-r--r--django/db/models/sql/query.py12
-rw-r--r--django/db/utils.py6
-rw-r--r--django/forms/fields.py6
-rw-r--r--django/shortcuts.py6
-rw-r--r--django/template/__init__.py2
-rw-r--r--django/template/backends/django.py8
-rw-r--r--django/template/base.py4
-rw-r--r--django/template/context.py6
-rw-r--r--django/template/defaultfilters.py6
-rw-r--r--django/template/defaulttags.py10
-rw-r--r--django/template/engine.py16
-rw-r--r--django/template/loader.py10
-rw-r--r--django/template/loaders/base.py2
-rw-r--r--django/template/response.py14
-rw-r--r--django/template/smartif.py8
-rw-r--r--django/template/utils.py6
-rw-r--r--django/templatetags/future.py10
-rw-r--r--django/test/testcases.py6
-rw-r--r--django/utils/checksums.py6
-rw-r--r--django/utils/deprecation.py5
-rw-r--r--django/utils/html.py6
-rw-r--r--django/views/generic/edit.py10
44 files changed, 145 insertions, 142 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 7ca099b47b..c4eb80a081 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -13,7 +13,7 @@ import warnings
from django.conf import global_settings
from django.core.exceptions import ImproperlyConfigured
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import LazyObject, empty
from django.utils import six
@@ -115,11 +115,11 @@ class Settings(BaseSettings):
if ('django.contrib.auth.middleware.AuthenticationMiddleware' in self.MIDDLEWARE_CLASSES and
'django.contrib.auth.middleware.SessionAuthenticationMiddleware' not in self.MIDDLEWARE_CLASSES):
warnings.warn(
- "Session verification will become mandatory in Django 2.0. "
+ "Session verification will become mandatory in Django 1.10. "
"Please add 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' "
"to your MIDDLEWARE_CLASSES setting when you are ready to opt-in after "
"reading the upgrade considerations in the 1.8 release notes.",
- RemovedInDjango20Warning
+ RemovedInDjango110Warning
)
if hasattr(time, 'tzset') and self.TIME_ZONE:
diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py
index 6ed54930c4..e88440dc0c 100644
--- a/django/conf/urls/__init__.py
+++ b/django/conf/urls/__init__.py
@@ -5,7 +5,7 @@ from django.core.urlresolvers import (RegexURLPattern,
RegexURLResolver, LocaleRegexURLResolver)
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
__all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patterns', 'url']
@@ -49,9 +49,9 @@ def include(arg, namespace=None, app_name=None):
def patterns(prefix, *args):
warnings.warn(
'django.conf.urls.patterns() is deprecated and will be removed in '
- 'Django 2.0. Update your urlpatterns to be a list of '
+ 'Django 1.10. Update your urlpatterns to be a list of '
'django.conf.urls.url() instances instead.',
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
pattern_list = []
for t in args:
@@ -72,9 +72,9 @@ def url(regex, view, kwargs=None, name=None, prefix=''):
if isinstance(view, six.string_types):
warnings.warn(
'Support for string view arguments to url() is deprecated and '
- 'will be removed in Django 2.0 (got %s). Pass the callable '
+ 'will be removed in Django 1.10 (got %s). Pass the callable '
'instead.' % view,
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
if not view:
raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex)
diff --git a/django/conf/urls/i18n.py b/django/conf/urls/i18n.py
index 9366a5f708..44e05b357d 100644
--- a/django/conf/urls/i18n.py
+++ b/django/conf/urls/i18n.py
@@ -4,7 +4,7 @@ from django.conf import settings
from django.conf.urls import patterns, url
from django.core.urlresolvers import LocaleRegexURLResolver
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.views.i18n import set_language
@@ -18,9 +18,9 @@ def i18n_patterns(prefix, *args):
warnings.warn(
"Calling i18n_patterns() with the `prefix` argument and with tuples "
"instead of django.conf.urls.url() instances is deprecated and "
- "will no longer work in Django 2.0. Use a list of "
+ "will no longer work in Django 1.10. Use a list of "
"django.conf.urls.url() instances instead.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
pattern_list = patterns(prefix, *args)
else:
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
index 07ea9a4813..e50939b2c1 100644
--- a/django/contrib/admin/helpers.py
+++ b/django/contrib/admin/helpers.py
@@ -14,7 +14,7 @@ from django.db.models.fields.related import ManyToManyRel
from django.forms.utils import flatatt
from django.template.defaultfilters import capfirst, linebreaksbr
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, smart_text
from django.utils.functional import cached_property
from django.utils.html import conditional_escape, format_html
@@ -284,9 +284,9 @@ class InlineAdminForm(AdminForm):
def original_content_type_id(self):
warnings.warn(
'InlineAdminForm.original_content_type_id is deprecated and will be '
- 'removed in Django 2.0. If you were using this attribute to construct '
+ 'removed in Django 1.10. If you were using this attribute to construct '
'the "view on site" URL, use the `absolute_url` attribute instead.',
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
if self.original is not None:
# Since this module gets imported in the application's root package,
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index 99363c392e..e57d151d55 100644
--- a/django/contrib/auth/views.py
+++ b/django/contrib/auth/views.py
@@ -16,7 +16,7 @@ from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.shortcuts import resolve_url
from django.template.response import TemplateResponse
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text
from django.utils.http import is_safe_url, urlsafe_base64_decode
from django.utils.six.moves.urllib.parse import urlparse, urlunparse
@@ -175,8 +175,8 @@ def password_reset(request, is_admin_site=False,
warnings.warn(
"The is_admin_site argument to "
"django.contrib.auth.views.password_reset() is deprecated "
- "and will be removed in Django 2.0.",
- RemovedInDjango20Warning, 3
+ "and will be removed in Django 1.10.",
+ RemovedInDjango110Warning, 3
)
opts = dict(opts, domain_override=request.get_host())
form.save(**opts)
diff --git a/django/contrib/contenttypes/models.py b/django/contrib/contenttypes/models.py
index 2aadf80027..27a5388a70 100644
--- a/django/contrib/contenttypes/models.py
+++ b/django/contrib/contenttypes/models.py
@@ -5,7 +5,7 @@ import warnings
from django.apps import apps
from django.db import models
from django.db.utils import IntegrityError, OperationalError, ProgrammingError
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@@ -41,7 +41,7 @@ class ContentTypeManager(models.Manager):
del kwargs['name']
warnings.warn(
"ContentType.name field doesn't exist any longer. Please remove it from your code.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
return super(ContentTypeManager, self).create(**kwargs)
def get_for_model(self, model, for_concrete_model=True):
diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py
index f287c778da..343610c90c 100644
--- a/django/contrib/gis/db/models/query.py
+++ b/django/contrib/gis/db/models/query.py
@@ -15,7 +15,7 @@ from django.db.models.expressions import RawSQL
from django.db.models.fields import Field
from django.db.models.query import QuerySet
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
class GeoQuerySet(QuerySet):
@@ -69,7 +69,7 @@ class GeoQuerySet(QuerySet):
warnings.warn(
"The collect GeoQuerySet method is deprecated. Use the Collect() "
"aggregate in an aggregate() or annotate() method.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return self._spatial_aggregate(aggregates.Collect, **kwargs)
@@ -114,7 +114,7 @@ class GeoQuerySet(QuerySet):
warnings.warn(
"The extent GeoQuerySet method is deprecated. Use the Extent() "
"aggregate in an aggregate() or annotate() method.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return self._spatial_aggregate(aggregates.Extent, **kwargs)
@@ -127,7 +127,7 @@ class GeoQuerySet(QuerySet):
warnings.warn(
"The extent3d GeoQuerySet method is deprecated. Use the Extent3D() "
"aggregate in an aggregate() or annotate() method.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return self._spatial_aggregate(aggregates.Extent3D, **kwargs)
@@ -234,7 +234,7 @@ class GeoQuerySet(QuerySet):
warnings.warn(
"The make_line GeoQuerySet method is deprecated. Use the MakeLine() "
"aggregate in an aggregate() or annotate() method.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return self._spatial_aggregate(aggregates.MakeLine, geo_field_type=PointField, **kwargs)
@@ -422,7 +422,7 @@ class GeoQuerySet(QuerySet):
warnings.warn(
"The unionagg GeoQuerySet method is deprecated. Use the Union() "
"aggregate in an aggregate() or annotate() method.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return self._spatial_aggregate(aggregates.Union, **kwargs)
diff --git a/django/contrib/gis/db/models/sql/aggregates.py b/django/contrib/gis/db/models/sql/aggregates.py
index b83bafda70..e3fb049cf5 100644
--- a/django/contrib/gis/db/models/sql/aggregates.py
+++ b/django/contrib/gis/db/models/sql/aggregates.py
@@ -7,4 +7,4 @@ __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] + aggregates.__
warnings.warn(
"django.contrib.gis.db.models.sql.aggregates is deprecated. Use "
"django.contrib.gis.db.models.aggregates instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
diff --git a/django/contrib/webdesign/__init__.py b/django/contrib/webdesign/__init__.py
index 635ed88a67..eacf09612c 100644
--- a/django/contrib/webdesign/__init__.py
+++ b/django/contrib/webdesign/__init__.py
@@ -1,11 +1,11 @@
import warnings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig'
warnings.warn(
- "django.contrib.webdesign will be removed in Django 2.0. The "
+ "django.contrib.webdesign will be removed in Django 1.10. The "
"{% lorem %} tag is now included in the built-in tags.",
- RemovedInDjango20Warning
+ RemovedInDjango110Warning
)
diff --git a/django/core/context_processors.py b/django/core/context_processors.py
index f2303bec59..f106439f12 100644
--- a/django/core/context_processors.py
+++ b/django/core/context_processors.py
@@ -1,9 +1,9 @@
import warnings
from django.template.context_processors import * # NOQA
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
warnings.warn(
"django.core.context_processors is deprecated in favor of "
"django.template.context_processors.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
diff --git a/django/core/files/storage.py b/django/core/files/storage.py
index 65b6d46463..e611d3ac7b 100644
--- a/django/core/files/storage.py
+++ b/django/core/files/storage.py
@@ -11,7 +11,7 @@ from django.core.files.move import file_move_safe
from django.utils._os import abspathu, safe_join
from django.utils.crypto import get_random_string
from django.utils.deconstruct import deconstructible
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import filepath_to_uri, force_text
from django.utils.functional import LazyObject
from django.utils.module_loading import import_string
@@ -56,8 +56,8 @@ class Storage(object):
warnings.warn(
'Backwards compatibility for storage backends without '
'support for the `max_length` argument in '
- 'Storage.get_available_name() will be removed in Django 2.0.',
- RemovedInDjango20Warning, stacklevel=2
+ 'Storage.get_available_name() will be removed in Django 1.10.',
+ RemovedInDjango110Warning, stacklevel=2
)
name = self.get_available_name(name)
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 3c3e5948aa..558cc320b9 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -18,7 +18,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import color_style, no_style
from django.db import connections
from django.utils.deprecation import (
- RemovedInDjango19Warning, RemovedInDjango20Warning,
+ RemovedInDjango19Warning, RemovedInDjango110Warning,
)
from django.utils.encoding import force_str
@@ -174,7 +174,7 @@ class BaseCommand(object):
``option_list``
This is the list of ``optparse`` options which will be fed
into the command's ``OptionParser`` for parsing arguments.
- Deprecated and will be removed in Django 2.0.
+ Deprecated and will be removed in Django 1.10.
``output_transaction``
A boolean indicating whether the command outputs SQL
@@ -306,7 +306,7 @@ class BaseCommand(object):
# Backwards compatibility: use deprecated optparse module
warnings.warn("OptionParser usage for Django management commands "
"is deprecated, use ArgumentParser instead",
- RemovedInDjango20Warning)
+ RemovedInDjango110Warning)
parser = OptionParser(prog=prog_name,
usage=self.usage(subcommand),
version=self.get_version())
@@ -648,9 +648,9 @@ class NoArgsCommand(BaseCommand):
def __init__(self):
warnings.warn(
- "NoArgsCommand class is deprecated and will be removed in Django 2.0. "
+ "NoArgsCommand class is deprecated and will be removed in Django 1.10. "
"Use BaseCommand instead, which takes no arguments by default.",
- RemovedInDjango20Warning
+ RemovedInDjango110Warning
)
super(NoArgsCommand, self).__init__()
diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py
index 720cf392cc..b372369166 100644
--- a/django/core/management/commands/migrate.py
+++ b/django/core/management/commands/migrate.py
@@ -20,7 +20,7 @@ from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.loader import AmbiguityError
from django.db.migrations.state import ProjectState
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.module_loading import module_has_submodule
@@ -73,7 +73,7 @@ class Command(BaseCommand):
if options.get("list", False):
warnings.warn(
"The 'migrate --list' command is deprecated. Use 'showmigrations' instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
self.stdout.ending = None # Remove when #21429 is fixed
return call_command(
'showmigrations',
diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index f7cb13291e..f7753cf092 100644
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -18,7 +18,7 @@ from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.http import Http404
from django.utils import lru_cache, six
from django.utils.datastructures import MultiValueDict
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_str, force_text, iri_to_uri
from django.utils.functional import lazy
from django.utils.http import RFC3986_SUBDELIMS, urlquote
@@ -442,7 +442,7 @@ class RegexURLResolver(LocaleRegexProvider):
if not callable(original_lookup) and callable(lookup_view):
warnings.warn(
'Reversing by dotted path is deprecated (%s).' % original_lookup,
- RemovedInDjango20Warning, stacklevel=3
+ RemovedInDjango110Warning, stacklevel=3
)
possibilities = self.reverse_dict.getlist(lookup_view)
diff --git a/django/db/backends/base/creation.py b/django/db/backends/base/creation.py
index 2c803e5539..72eb345e09 100644
--- a/django/db/backends/base/creation.py
+++ b/django/db/backends/base/creation.py
@@ -8,7 +8,7 @@ from django.conf import settings
from django.core import serializers
from django.db import router
from django.db.backends.utils import truncate_name
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_bytes
from django.utils.six import StringIO
from django.utils.six.moves import input
@@ -191,7 +191,7 @@ class BaseDatabaseCreation(object):
"""
warnings.warn("DatabaseCreation.sql_indexes_for_model is deprecated, "
"use the equivalent method of the schema editor instead.",
- RemovedInDjango20Warning)
+ RemovedInDjango110Warning)
if not model._meta.managed or model._meta.proxy or model._meta.swapped:
return []
output = []
diff --git a/django/db/models/aggregates.py b/django/db/models/aggregates.py
index b51fe5635a..1b3c4133ce 100644
--- a/django/db/models/aggregates.py
+++ b/django/db/models/aggregates.py
@@ -41,7 +41,7 @@ class Aggregate(Func):
def _patch_aggregate(self, query):
"""
Helper method for patching 3rd party aggregates that do not yet support
- the new way of subclassing. This method should be removed in 2.0
+ the new way of subclassing. This method will be removed in Django 1.10.
add_to_query(query, alias, col, source, is_summary) will be defined on
legacy aggregates which, in turn, instantiates the SQL implementation of
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
index ba79e927dd..73c67bef81 100644
--- a/django/db/models/fields/files.py
+++ b/django/db/models/fields/files.py
@@ -11,7 +11,7 @@ from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_str, force_text
from django.utils.translation import ugettext_lazy as _
@@ -96,8 +96,8 @@ class FieldFile(File):
warnings.warn(
'Backwards compatibility for storage backends without '
'support for the `max_length` argument in '
- 'Storage.save() will be removed in Django 2.0.',
- RemovedInDjango20Warning, stacklevel=2
+ 'Storage.save() will be removed in Django 1.10.',
+ RemovedInDjango110Warning, stacklevel=2
)
self.name = self.storage.save(name, content)
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 4ab4334e25..2f06d4d008 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -19,7 +19,7 @@ from django.db.models.lookups import IsNull
from django.db.models.query import QuerySet
from django.db.models.query_utils import PathInfo
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, smart_text
from django.utils.functional import cached_property, curry
from django.utils.translation import ugettext_lazy as _
@@ -340,7 +340,7 @@ class RelatedField(Field):
def related(self):
warnings.warn(
"Usage of field.related has been deprecated. Use field.rel instead.",
- RemovedInDjango20Warning, 2)
+ RemovedInDjango110Warning, 2)
return self.rel
def do_related_class(self, other, cls):
diff --git a/django/db/models/fields/subclassing.py b/django/db/models/fields/subclassing.py
index 4233106429..84d13ce85c 100644
--- a/django/db/models/fields/subclassing.py
+++ b/django/db/models/fields/subclassing.py
@@ -9,7 +9,7 @@ seamlessly.
import warnings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
class SubfieldBase(type):
@@ -19,7 +19,7 @@ class SubfieldBase(type):
"""
def __new__(cls, name, bases, attrs):
warnings.warn("SubfieldBase has been deprecated. Use Field.from_db_value instead.",
- RemovedInDjango20Warning)
+ RemovedInDjango110Warning)
new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
new_class.contribute_to_class = make_contrib(
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 0525607678..69331c5691 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -13,7 +13,7 @@ from django.db.models.fields.proxy import OrderWrt
from django.db.models.fields.related import ManyToManyField
from django.utils import six
from django.utils.datastructures import ImmutableList, OrderedSet
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import (
force_text, python_2_unicode_compatible, smart_text,
)
@@ -51,7 +51,7 @@ class raise_deprecation(object):
fn.__name__,
self.suggested_alternative,
),
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return fn(*args, **kwargs)
return wrapper
@@ -509,7 +509,7 @@ class Options(object):
only forward fields will be returned.
The many_to_many argument exists for backwards compatibility reasons;
- it has been deprecated and will be removed in Django 2.0.
+ it has been deprecated and will be removed in Django 1.10.
"""
m2m_in_kwargs = many_to_many is not None
if m2m_in_kwargs:
@@ -518,7 +518,7 @@ class Options(object):
warnings.warn(
"The 'many_to_many' argument on get_field() is deprecated; "
"use a filter on field.many_to_many instead.",
- RemovedInDjango20Warning
+ RemovedInDjango110Warning
)
try:
diff --git a/django/db/models/sql/aggregates.py b/django/db/models/sql/aggregates.py
index 0ebe10e83f..5e73e4fc6a 100644
--- a/django/db/models/sql/aggregates.py
+++ b/django/db/models/sql/aggregates.py
@@ -6,7 +6,7 @@ import warnings
from django.db.models.fields import FloatField, IntegerField
from django.db.models.lookups import RegisterLookupMixin
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
__all__ = ['Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance']
@@ -15,7 +15,7 @@ __all__ = ['Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance
warnings.warn(
"django.db.models.sql.aggregates is deprecated. Use "
"django.db.models.aggregates instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
class Aggregate(RegisterLookupMixin):
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 6aab204598..688e3f741e 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -13,7 +13,7 @@ from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.query import Query, get_order_dir
from django.db.transaction import TransactionManagementError
from django.db.utils import DatabaseError
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.six.moves import zip
@@ -329,7 +329,7 @@ class SQLCompiler(object):
warnings.warn(
"Calling a SQLCompiler directly is deprecated. "
"Call compiler.quote_name_unless_alias instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
return self.quote_name_unless_alias(name)
def quote_name_unless_alias(self, name):
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index d0b56449b2..7a0fe8f892 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -31,7 +31,7 @@ from django.db.models.sql.where import (
)
from django.utils import six
from django.utils.deprecation import (
- RemovedInDjango19Warning, RemovedInDjango20Warning,
+ RemovedInDjango19Warning, RemovedInDjango110Warning,
)
from django.utils.encoding import force_text
from django.utils.tree import Node
@@ -201,7 +201,7 @@ class Query(object):
def aggregates(self):
warnings.warn(
"The aggregates property is deprecated. Use annotations instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
return self.annotations
def __str__(self):
@@ -971,7 +971,7 @@ class Query(object):
def add_aggregate(self, aggregate, model, alias, is_summary):
warnings.warn(
"add_aggregate() is deprecated. Use add_annotation() instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
self.add_annotation(aggregate, alias, is_summary)
def add_annotation(self, annotation, alias, is_summary=False):
@@ -1887,7 +1887,7 @@ class Query(object):
def set_aggregate_mask(self, names):
warnings.warn(
"set_aggregate_mask() is deprecated. Use set_annotation_mask() instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
self.set_annotation_mask(names)
def set_annotation_mask(self, names):
@@ -1901,7 +1901,7 @@ class Query(object):
def append_aggregate_mask(self, names):
warnings.warn(
"append_aggregate_mask() is deprecated. Use append_annotation_mask() instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
self.append_annotation_mask(names)
def append_annotation_mask(self, names):
@@ -1944,7 +1944,7 @@ class Query(object):
def aggregate_select(self):
warnings.warn(
"aggregate_select() is deprecated. Use annotation_select() instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
return self.annotation_select
@property
diff --git a/django/db/utils.py b/django/db/utils.py
index d8aa34d30f..2261a69f71 100644
--- a/django/db/utils.py
+++ b/django/db/utils.py
@@ -10,7 +10,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils._os import upath
from django.utils.deprecation import (
- RemovedInDjango19Warning, RemovedInDjango20Warning,
+ RemovedInDjango19Warning, RemovedInDjango110Warning,
)
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
@@ -339,8 +339,8 @@ class ConnectionRouter(object):
"The signature of allow_migrate has changed from "
"allow_migrate(self, db, model) to "
"allow_migrate(self, db, app_label, model_name=None, **hints). "
- "Support for the old signature will be removed in Django 2.0.",
- RemovedInDjango20Warning)
+ "Support for the old signature will be removed in Django 1.10.",
+ RemovedInDjango110Warning)
model = hints.get('model')
allow = None if model is None else method(db, model)
else:
diff --git a/django/forms/fields.py b/django/forms/fields.py
index 53520530b6..bcaa146e4e 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -29,7 +29,7 @@ from django.forms.widgets import (
from django.utils import formats, six
from django.utils.dateparse import parse_duration
from django.utils.deprecation import (
- RemovedInDjango19Warning, RemovedInDjango20Warning, RenameMethodsBase,
+ RemovedInDjango19Warning, RemovedInDjango110Warning, RenameMethodsBase,
)
from django.utils.duration import duration_string
from django.utils.encoding import force_str, force_text, smart_text
@@ -50,7 +50,7 @@ __all__ = (
class RenameFieldMethods(RenameMethodsBase):
renamed_methods = (
- ('_has_changed', 'has_changed', RemovedInDjango20Warning),
+ ('_has_changed', 'has_changed', RemovedInDjango110Warning),
)
@@ -553,7 +553,7 @@ class RegexField(CharField):
warnings.warn(
"The 'error_message' argument is deprecated. Use "
"Field.error_messages['invalid'] instead.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
error_messages = kwargs.get('error_messages') or {}
error_messages['invalid'] = error_message
diff --git a/django/shortcuts.py b/django/shortcuts.py
index 415e51887e..90b2df3dd8 100644
--- a/django/shortcuts.py
+++ b/django/shortcuts.py
@@ -19,7 +19,7 @@ from django.template.engine import (
_context_instance_undefined, _dictionary_undefined, _dirs_undefined,
)
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text
from django.utils.functional import Promise
@@ -62,7 +62,7 @@ def render(request, template_name, context=None,
and dirs is _dirs_undefined
and dictionary is _dictionary_undefined):
# No deprecated arguments were passed - use the new code path
- # In Django 2.0, request should become a positional argument.
+ # In Django 1.10, request should become a positional argument.
content = loader.render_to_string(
template_name, context, request=request, using=using)
@@ -78,7 +78,7 @@ def render(request, template_name, context=None,
warnings.warn(
"The current_app argument of render is deprecated. "
"Set the current_app attribute of request instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
request.current_app = current_app
# Directly set the private attribute to avoid triggering the
# warning in RequestContext.__init__.
diff --git a/django/template/__init__.py b/django/template/__init__.py
index b2566decad..aa80a3dbb2 100644
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -62,7 +62,7 @@ from .context import ContextPopException # NOQA
from .base import (Context, Node, NodeList, RequestContext, # NOQA
StringOrigin, Template, Variable)
-# Deprecated in Django 1.8, will be removed in Django 2.0.
+# Deprecated in Django 1.8, will be removed in Django 1.10.
from .base import resolve_variable # NOQA
# Library management
diff --git a/django/template/backends/django.py b/django/template/backends/django.py
index 5940c0b457..f6aa8451d8 100644
--- a/django/template/backends/django.py
+++ b/django/template/backends/django.py
@@ -6,7 +6,7 @@ import warnings
from django.conf import settings
from django.template.context import Context, RequestContext, make_context
from django.template.engine import Engine, _dirs_undefined
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from .base import BaseEngine
@@ -49,7 +49,7 @@ class Template(object):
# >>> template.render(Context({'name': 'world'}))
# In Django 1.7 get_template() returned a django.template.Template.
# In Django 1.8 it returns a django.template.backends.django.Template.
- # In Django 2.0 the isinstance checks should be removed. If passing a
+ # In Django 1.10 the isinstance checks should be removed. If passing a
# Context or a RequestContext works by accident, it won't be an issue
# per se, but it won't be officially supported either.
if isinstance(context, RequestContext):
@@ -61,12 +61,12 @@ class Template(object):
"the two arguments refer to the same request.")
warnings.warn(
"render() must be called with a dict, not a RequestContext.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
elif isinstance(context, Context):
warnings.warn(
"render() must be called with a dict, not a Context.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
else:
context = make_context(context, request)
diff --git a/django/template/base.py b/django/template/base.py
index 184562129b..5661bdc000 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -62,7 +62,7 @@ from django.template.context import ( # NOQA: imported for backwards compatibil
BaseContext, Context, ContextPopException, RequestContext,
)
from django.utils import lru_cache, six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import (
force_str, force_text, python_2_unicode_compatible,
)
@@ -710,7 +710,7 @@ def resolve_variable(path, context):
"""
warnings.warn("resolve_variable() is deprecated. Use django.template."
"Variable(path).resolve(context) instead",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
return Variable(path).resolve(context)
diff --git a/django/template/context.py b/django/template/context.py
index e77866cc5d..8a0d477e4f 100644
--- a/django/template/context.py
+++ b/django/template/context.py
@@ -2,7 +2,7 @@ import warnings
from contextlib import contextmanager
from copy import copy
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
@@ -129,7 +129,7 @@ class Context(BaseContext):
warnings.warn(
"The current_app argument of Context is deprecated. Use "
"RequestContext and set the current_app attribute of its "
- "request instead.", RemovedInDjango20Warning, stacklevel=2)
+ "request instead.", RemovedInDjango110Warning, stacklevel=2)
self.autoescape = autoescape
self._current_app = current_app
self.use_l10n = use_l10n
@@ -214,7 +214,7 @@ class RequestContext(Context):
warnings.warn(
"The current_app argument of RequestContext is deprecated. "
"Set the current_app attribute of its request instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
self._current_app = current_app
self.request = request
self._processors = () if processors is None else tuple(processors)
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index a3a9004494..6aefb3cbf2 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -12,7 +12,7 @@ from django.conf import settings
from django.template.base import Library, Variable, VariableDoesNotExist
from django.utils import formats, six
from django.utils.dateformat import format, time_format
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, iri_to_uri
from django.utils.html import (
avoid_wrapping, conditional_escape, escape, escapejs, linebreaks,
@@ -714,8 +714,8 @@ def unordered_list(value, autoescape=True):
if converted:
warnings.warn(
"The old style syntax in `unordered_list` is deprecated and will "
- "be removed in Django 2.0. Use the the new format instead.",
- RemovedInDjango20Warning)
+ "be removed in Django 1.10. Use the the new format instead.",
+ RemovedInDjango110Warning)
return mark_safe(list_formatter(value))
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 4f3a5fb3ef..09c0e72d3b 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -20,7 +20,7 @@ from django.template.base import (
from django.template.defaultfilters import date
from django.template.smartif import IfParser, Literal
from django.utils import six, timezone
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, smart_text
from django.utils.html import format_html
from django.utils.lorem_ipsum import paragraphs, words
@@ -197,9 +197,9 @@ class ForNode(Node):
if num_loopvars != len_item:
warnings.warn(
"Need {} values to unpack in for loop; got {}. "
- "This will raise an exception in Django 2.0."
+ "This will raise an exception in Django 1.10."
.format(num_loopvars, len_item),
- RemovedInDjango20Warning)
+ RemovedInDjango110Warning)
try:
unpacked_vars = dict(zip(self.loopvars, item))
except TypeError:
@@ -481,7 +481,7 @@ class URLNode(Node):
current_app = context.request.current_app
except AttributeError:
# Change the fallback value to None when the deprecation path for
- # Context.current_app completes in Django 2.0.
+ # Context.current_app completes in Django 1.10.
current_app = context.current_app
# Try to look up the URL twice: once given the view name, and again
@@ -1095,7 +1095,7 @@ def ssi(parser, token):
"""
warnings.warn(
"The {% ssi %} tag is deprecated. Use the {% include %} tag instead.",
- RemovedInDjango20Warning,
+ RemovedInDjango110Warning,
)
bits = token.split_contents()
diff --git a/django/template/engine.py b/django/template/engine.py
index 6856dd960f..f6547ac3e1 100644
--- a/django/template/engine.py
+++ b/django/template/engine.py
@@ -2,7 +2,7 @@ import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
@@ -117,7 +117,7 @@ class Engine(object):
warnings.warn(
"%s inherits from django.template.loader.BaseLoader "
"instead of django.template.loaders.base.Loader. " %
- loader, RemovedInDjango20Warning, stacklevel=2)
+ loader, RemovedInDjango110Warning, stacklevel=2)
loader_instance = loader_class(*args)
@@ -162,7 +162,7 @@ class Engine(object):
else:
warnings.warn(
"The dirs argument of get_template is deprecated.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
template, origin = self.find_template(template_name, dirs)
if not hasattr(template, 'render'):
@@ -173,7 +173,7 @@ class Engine(object):
# This method was originally a function defined in django.template.loader.
# It was moved here in Django 1.8 when encapsulating the Django template
# engine in this Engine class. It's still called by deprecated code but it
- # will be removed in Django 2.0. It's superseded by a new render_to_string
+ # will be removed in Django 1.10. It's superseded by a new render_to_string
# function in django.template.loader.
def render_to_string(self, template_name, context=None,
@@ -185,7 +185,7 @@ class Engine(object):
else:
warnings.warn(
"The context_instance argument of render_to_string is "
- "deprecated.", RemovedInDjango20Warning, stacklevel=2)
+ "deprecated.", RemovedInDjango110Warning, stacklevel=2)
if dirs is _dirs_undefined:
# Do not set dirs to None here to avoid triggering the deprecation
# warning in select_template or get_template.
@@ -193,13 +193,13 @@ class Engine(object):
else:
warnings.warn(
"The dirs argument of render_to_string is deprecated.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
if dictionary is _dictionary_undefined:
dictionary = None
else:
warnings.warn(
"The dictionary argument of render_to_string was renamed to "
- "context.", RemovedInDjango20Warning, stacklevel=2)
+ "context.", RemovedInDjango110Warning, stacklevel=2)
context = dictionary
if isinstance(template_name, (list, tuple)):
@@ -231,7 +231,7 @@ class Engine(object):
else:
warnings.warn(
"The dirs argument of select_template is deprecated.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
if not template_name_list:
raise TemplateDoesNotExist("No template names provided")
diff --git a/django/template/loader.py b/django/template/loader.py
index c8fb16bf92..90397d9540 100644
--- a/django/template/loader.py
+++ b/django/template/loader.py
@@ -1,6 +1,6 @@
import warnings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from . import engines
from .backends.django import DjangoTemplates
@@ -30,7 +30,7 @@ def get_template(template_name, dirs=_dirs_undefined, using=None):
for engine in engines:
try:
# This is required for deprecating the dirs argument. Simply
- # return engine.get_template(template_name) in Django 2.0.
+ # return engine.get_template(template_name) in Django 1.10.
if isinstance(engine, DjangoTemplates):
return engine.get_template(template_name, dirs)
elif dirs is not _dirs_undefined:
@@ -59,7 +59,7 @@ def select_template(template_name_list, dirs=_dirs_undefined, using=None):
for engine in engines:
try:
# This is required for deprecating the dirs argument. Simply
- # use engine.get_template(template_name) in Django 2.0.
+ # use engine.get_template(template_name) in Django 1.10.
if isinstance(engine, DjangoTemplates):
return engine.get_template(template_name, dirs)
elif dirs is not _dirs_undefined:
@@ -104,7 +104,7 @@ def render_to_string(template_name, context=None,
try:
# This is required for deprecating properly arguments specific
# to Django templates. Remove Engine.render_to_string() at the
- # same time as this code path in Django 2.0.
+ # same time as this code path in Django 1.10.
if isinstance(engine, DjangoTemplates):
if request is not None:
raise ValueError(
@@ -151,5 +151,5 @@ class BaseLoader(base.Loader):
warnings.warn(
"django.template.loader.BaseLoader was superseded by "
"django.template.loaders.base.Loader.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
super(BaseLoader, self).__init__(*args, **kwargs)
diff --git a/django/template/loaders/base.py b/django/template/loaders/base.py
index c7060725c7..cf487f0700 100644
--- a/django/template/loaders/base.py
+++ b/django/template/loaders/base.py
@@ -3,7 +3,7 @@ from django.template.base import Template, TemplateDoesNotExist
class Loader(object):
is_usable = False
- # Only used to raise a deprecation warning. Remove in Django 2.0.
+ # Only used to raise a deprecation warning. Remove in Django 1.10.
_accepts_engine_in_init = True
def __init__(self, engine):
diff --git a/django/template/response.py b/django/template/response.py
index 094907ed97..3f7c90c71c 100644
--- a/django/template/response.py
+++ b/django/template/response.py
@@ -5,7 +5,7 @@ from django.template import Context, RequestContext, Template, loader
from django.template.backends.django import Template as BackendTemplate
from django.template.context import _current_app_undefined
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
class ContentNotRenderedError(Exception):
@@ -22,7 +22,7 @@ class SimpleTemplateResponse(HttpResponse):
"{}'s template argument cannot be a django.template.Template "
"anymore. It may be a backend-specific template like those "
"created by get_template().".format(self.__class__.__name__),
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
template = BackendTemplate(template)
# It would seem obvious to call these next two members 'template' and
@@ -84,7 +84,7 @@ class SimpleTemplateResponse(HttpResponse):
def _resolve_template(self, template):
# This wrapper deprecates returning a django.template.Template in
# subclasses that override resolve_template. It can be removed in
- # Django 2.0.
+ # Django 1.10.
new_template = self.resolve_template(template)
if isinstance(new_template, Template):
warnings.warn(
@@ -92,7 +92,7 @@ class SimpleTemplateResponse(HttpResponse):
"template like those created by get_template(), not a "
"{}.".format(
self.__class__.__name__, new_template.__class__.__name__),
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
new_template = BackendTemplate(new_template)
return new_template
@@ -102,7 +102,7 @@ class SimpleTemplateResponse(HttpResponse):
def _resolve_context(self, context):
# This wrapper deprecates returning a Context or a RequestContext in
# subclasses that override resolve_context. It can be removed in
- # Django 2.0. If returning a Context or a RequestContext works by
+ # Django 1.10. If returning a Context or a RequestContext works by
# accident, it won't be an issue per se, but it won't be officially
# supported either.
new_context = self.resolve_context(context)
@@ -112,7 +112,7 @@ class SimpleTemplateResponse(HttpResponse):
warnings.warn(
"{}.resolve_context() must return a dict, not a {}.".format(
self.__class__.__name__, new_context.__class__.__name__),
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
# It would be tempting to do new_context = new_context.flatten()
# here but that would cause template context processors to run for
# TemplateResponse(request, template, Context({})), which would be
@@ -199,7 +199,7 @@ class TemplateResponse(SimpleTemplateResponse):
warnings.warn(
"The current_app argument of TemplateResponse is deprecated. "
"Set the current_app attribute of its request instead.",
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
request.current_app = current_app
super(TemplateResponse, self).__init__(
template, context, content_type, status, charset, using)
diff --git a/django/template/smartif.py b/django/template/smartif.py
index 7b5a0083da..36c76cb5e6 100644
--- a/django/template/smartif.py
+++ b/django/template/smartif.py
@@ -3,7 +3,7 @@ Parser and utilities for the smart 'if' tag
"""
import warnings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
# Using a simple top down parser, as described here:
@@ -102,7 +102,7 @@ OPERATORS = {
'not': prefix(8, lambda context, x: not x.eval(context)),
'in': infix(9, lambda context, x, y: x.eval(context) in y.eval(context)),
'not in': infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)),
- # This should be removed in Django 2.0:
+ # This should be removed in Django 1.10:
'=': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),
'==': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),
'!=': infix(10, lambda context, x, y: x.eval(context) != y.eval(context)),
@@ -180,8 +180,8 @@ class IfParser(object):
else:
if token == '=':
warnings.warn(
- "Operator '=' is deprecated and will be removed in Django 2.0. Use '==' instead.",
- RemovedInDjango20Warning, stacklevel=2
+ "Operator '=' is deprecated and will be removed in Django 1.10. Use '==' instead.",
+ RemovedInDjango110Warning, stacklevel=2
)
return op()
diff --git a/django/template/utils.py b/django/template/utils.py
index ea72a8c5b1..cbf0de148d 100644
--- a/django/template/utils.py
+++ b/django/template/utils.py
@@ -7,7 +7,7 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache
from django.utils._os import upath
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
@@ -33,8 +33,8 @@ class EngineHandler(object):
if not self._templates:
warnings.warn(
"You haven't defined a TEMPLATES setting. You must do so "
- "before upgrading to Django 2.0. Otherwise Django will be "
- "unable to load templates.", RemovedInDjango20Warning)
+ "before upgrading to Django 1.10. Otherwise Django will be "
+ "unable to load templates.", RemovedInDjango110Warning)
self._templates = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
diff --git a/django/templatetags/future.py b/django/templatetags/future.py
index 53d22866dd..ffc4f3c12d 100644
--- a/django/templatetags/future.py
+++ b/django/templatetags/future.py
@@ -2,7 +2,7 @@ import warnings
from django.template import Library, defaulttags
from django.utils.deprecation import (
- RemovedInDjango19Warning, RemovedInDjango20Warning,
+ RemovedInDjango19Warning, RemovedInDjango110Warning,
)
register = Library()
@@ -47,8 +47,8 @@ def cycle(parser, token):
"""
warnings.warn(
"Loading the `cycle` tag from the `future` library is deprecated and "
- "will be removed in Django 2.0. Use the default `cycle` tag instead.",
- RemovedInDjango20Warning)
+ "will be removed in Django 1.10. Use the default `cycle` tag instead.",
+ RemovedInDjango110Warning)
return defaulttags.cycle(parser, token)
@@ -82,6 +82,6 @@ def firstof(parser, token):
"""
warnings.warn(
"Loading the `firstof` tag from the `future` library is deprecated and "
- "will be removed in Django 2.0. Use the default `firstof` tag instead.",
- RemovedInDjango20Warning)
+ "will be removed in Django 1.10. Use the default `firstof` tag instead.",
+ RemovedInDjango110Warning)
return defaulttags.firstof(parser, token)
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 3b40a64be5..ecf0eda4e8 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -38,7 +38,7 @@ from django.test.utils import (
override_settings,
)
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text
from django.utils.six.moves.urllib.parse import (
unquote, urlparse, urlsplit, urlunsplit,
@@ -206,9 +206,9 @@ class SimpleTestCase(unittest.TestCase):
if hasattr(self, 'urls'):
warnings.warn(
"SimpleTestCase.urls is deprecated and will be removed in "
- "Django 2.0. Use @override_settings(ROOT_URLCONF=...) "
+ "Django 1.10. Use @override_settings(ROOT_URLCONF=...) "
"in %s instead." % self.__class__.__name__,
- RemovedInDjango20Warning, stacklevel=2)
+ RemovedInDjango110Warning, stacklevel=2)
set_urlconf(None)
self._old_root_urlconf = settings.ROOT_URLCONF
settings.ROOT_URLCONF = self.urls
diff --git a/django/utils/checksums.py b/django/utils/checksums.py
index 40d6814d52..c74631acb2 100644
--- a/django/utils/checksums.py
+++ b/django/utils/checksums.py
@@ -7,12 +7,12 @@ __all__ = ['luhn']
import warnings
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
warnings.warn(
- "django.utils.checksums will be removed in Django 2.0. The "
+ "django.utils.checksums will be removed in Django 1.10. The "
"luhn() function is now included in django-localflavor 1.1+.",
- RemovedInDjango20Warning
+ RemovedInDjango110Warning
)
LUHN_ODD_LOOKUP = (0, 2, 4, 6, 8, 1, 3, 5, 7, 9) # sum_of_digits(index * 2)
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index e6a818c9c4..6a0c91daa0 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -2,9 +2,12 @@ import inspect
import warnings
-class RemovedInDjango20Warning(PendingDeprecationWarning):
+class RemovedInDjango110Warning(PendingDeprecationWarning):
pass
+# for backwards compatibility in Django 1.8.3
+RemovedInDjango20Warning = PendingDeprecationWarning
+
class RemovedInDjango19Warning(DeprecationWarning):
pass
diff --git a/django/utils/html.py b/django/utils/html.py
index 837a17f171..a2672d432c 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -7,7 +7,7 @@ import sys
import warnings
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_str, force_text
from django.utils.functional import allow_lazy
from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS
@@ -198,7 +198,7 @@ def remove_tags(html, tags):
warnings.warn(
"django.utils.html.remove_tags() and the removetags template filter "
"are deprecated. Consider using the bleach library instead.",
- RemovedInDjango20Warning, stacklevel=3
+ RemovedInDjango110Warning, stacklevel=3
)
tags = [re.escape(tag) for tag in tags.split()]
tags_re = '(%s)' % '|'.join(tags)
@@ -220,7 +220,7 @@ def strip_entities(value):
"""Returns the given HTML with all entities (&something;) stripped."""
warnings.warn(
"django.utils.html.strip_entities() is deprecated.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return re.sub(r'&(?:\w+|#\d+);', '', force_text(value))
strip_entities = allow_lazy(strip_entities, six.text_type)
diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py
index 2a2590263f..08c090e541 100644
--- a/django/views/generic/edit.py
+++ b/django/views/generic/edit.py
@@ -6,14 +6,14 @@ from django.core.exceptions import ImproperlyConfigured
from django.forms import models as model_forms
from django.http import HttpResponseRedirect
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
from django.views.generic.detail import (
BaseDetailView, SingleObjectMixin, SingleObjectTemplateResponseMixin,
)
-PERCENT_PLACEHOLDER_REGEX = re.compile(r'%\([^\)]+\)') # RemovedInDjango20Warning
+PERCENT_PLACEHOLDER_REGEX = re.compile(r'%\([^\)]+\)') # RemovedInDjango110Warning
class FormMixinBase(type):
@@ -26,7 +26,7 @@ class FormMixinBase(type):
warnings.warn(
"`%s.%s.get_form` method must define a default value for "
"its `form_class` argument." % (attrs['__module__'], name),
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
def get_form_with_form_class(self, form_class=None):
@@ -172,7 +172,7 @@ class ModelFormMixin(FormMixin, SingleObjectMixin):
warnings.warn(
"%()s placeholder style in success_url is deprecated. "
"Please replace them by the {} Python format syntax.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
url = self.success_url % self.object.__dict__
else:
@@ -308,7 +308,7 @@ class DeletionMixin(object):
warnings.warn(
"%()s placeholder style in success_url is deprecated. "
"Please replace them by the {} Python format syntax.",
- RemovedInDjango20Warning, stacklevel=2
+ RemovedInDjango110Warning, stacklevel=2
)
return self.success_url % self.object.__dict__
else: