Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed deprecation warnings on master #4916

Merged
merged 1 commit into from Jun 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions django/conf/__init__.py
Expand Up @@ -13,7 +13,7 @@

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

ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
Expand Down Expand Up @@ -114,11 +114,11 @@ def __init__(self, settings_module):
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:
Expand Down
19 changes: 10 additions & 9 deletions django/conf/urls/__init__.py
Expand Up @@ -5,8 +5,9 @@
RegexURLResolver, LocaleRegexURLResolver)
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning, RemovedInDjango21Warning

from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedInDjango110Warning,
)

__all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patterns', 'url']

Expand All @@ -23,7 +24,7 @@ def include(arg, namespace=None, app_name=None):
warnings.warn(
'The app_name argument to django.conf.urls.include() is deprecated. '
'Set the app_name in the included URLconf instead.',
RemovedInDjango21Warning, stacklevel=2
RemovedInDjango20Warning, stacklevel=2
)

if isinstance(arg, tuple):
Expand All @@ -39,7 +40,7 @@ def include(arg, namespace=None, app_name=None):
'Passing a 3-tuple to django.conf.urls.include() is deprecated. '
'Pass a 2-tuple containing the list of patterns and app_name, '
'and provide the namespace argument to include() instead.',
RemovedInDjango21Warning, stacklevel=2
RemovedInDjango20Warning, stacklevel=2
)
urlconf_module, app_name, namespace = arg
else:
Expand All @@ -56,7 +57,7 @@ def include(arg, namespace=None, app_name=None):
'providing an app_name is deprecated. Set the app_name attribute '
'in the included module, or pass a 2-tuple containing the list of '
'patterns and app_name instead.',
RemovedInDjango21Warning, stacklevel=2
RemovedInDjango20Warning, stacklevel=2
)

namespace = namespace or app_name
Expand All @@ -77,9 +78,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:
Expand All @@ -100,9 +101,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)
Expand Down
6 changes: 3 additions & 3 deletions django/conf/urls/i18n.py
Expand Up @@ -4,7 +4,7 @@
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


Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions django/contrib/admin/helpers.py
Expand Up @@ -14,7 +14,7 @@
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
Expand Down Expand Up @@ -285,9 +285,9 @@ def __init__(self, formset, form, fieldsets, prepopulated_fields, original,
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,
Expand Down
4 changes: 2 additions & 2 deletions django/contrib/auth/tests/utils.py
Expand Up @@ -2,7 +2,7 @@
from unittest import skipIf

from django.conf import settings
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.deprecation import RemovedInDjango20Warning


def skipIfCustomUser(test_func):
Expand All @@ -11,6 +11,6 @@ def skipIfCustomUser(test_func):
"""
warnings.warn(
"django.contrib.auth.tests.utils.skipIfCustomUser is deprecated.",
RemovedInDjango21Warning, stacklevel=2)
RemovedInDjango20Warning, stacklevel=2)

return skipIf(settings.AUTH_USER_MODEL != 'auth.User', 'Custom user model in use')(test_func)
6 changes: 3 additions & 3 deletions django/contrib/auth/views.py
Expand Up @@ -16,7 +16,7 @@
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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions django/contrib/contenttypes/models.py
Expand Up @@ -5,7 +5,7 @@
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 _

Expand Down Expand Up @@ -41,7 +41,7 @@ def create(self, **kwargs):
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):
Expand Down
4 changes: 2 additions & 2 deletions django/contrib/gis/db/models/manager.py
Expand Up @@ -2,7 +2,7 @@

from django.contrib.gis.db.models.query import GeoQuerySet
from django.db.models.manager import Manager
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.deprecation import RemovedInDjango20Warning


class GeoManager(Manager.from_queryset(GeoQuerySet)):
Expand All @@ -17,6 +17,6 @@ def __init__(self, *args, **kwargs):
warnings.warn(
"The GeoManager class is deprecated. Simply use a normal manager "
"once you have replaced all calls to GeoQuerySet methods by annotations.",
RemovedInDjango21Warning, stacklevel=2
RemovedInDjango20Warning, stacklevel=2
)
super(GeoManager, self).__init__(*args, **kwargs)
14 changes: 7 additions & 7 deletions django/contrib/gis/db/models/query.py
Expand Up @@ -16,7 +16,7 @@
from django.db.models.query import QuerySet
from django.utils import six
from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedInDjango21Warning,
RemovedInDjango20Warning, RemovedInDjango110Warning,
)


Expand Down Expand Up @@ -71,7 +71,7 @@ def collect(self, **kwargs):
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)

Expand Down Expand Up @@ -116,7 +116,7 @@ def extent(self, **kwargs):
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)

Expand All @@ -129,7 +129,7 @@ def extent3d(self, **kwargs):
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)

Expand Down Expand Up @@ -236,7 +236,7 @@ def make_line(self, **kwargs):
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)

Expand Down Expand Up @@ -424,7 +424,7 @@ def unionagg(self, **kwargs):
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)

Expand Down Expand Up @@ -518,7 +518,7 @@ def _spatial_attribute(self, att, settings, field_name=None, model_att=None):
warnings.warn(
"The %s GeoQuerySet method is deprecated. See GeoDjango Functions "
"documentation to find the expression-based replacement." % att,
RemovedInDjango21Warning, stacklevel=2
RemovedInDjango20Warning, stacklevel=2
)
# Default settings.
settings.setdefault('desc', None)
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/models/sql/aggregates.py
Expand Up @@ -7,4 +7,4 @@
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)
6 changes: 3 additions & 3 deletions 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
)
4 changes: 2 additions & 2 deletions 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)
6 changes: 3 additions & 3 deletions django/core/files/storage.py
Expand Up @@ -10,7 +10,7 @@
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.inspect import func_supports_parameter
Expand Down Expand Up @@ -55,8 +55,8 @@ def save(self, name, content, max_length=None):
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)

Expand Down
6 changes: 3 additions & 3 deletions django/core/handlers/base.py
Expand Up @@ -14,7 +14,7 @@
from django.db import connections, transaction
from django.http.multipartparser import MultiPartParserError
from django.utils import six
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_text
from django.utils.module_loading import import_string
from django.views import debug
Expand Down Expand Up @@ -93,8 +93,8 @@ def get_exception_response(self, request, resolver, status_code, exception):
except TypeError:
warnings.warn(
"Error handlers should accept an exception parameter. Update "
"your code as this parameter will be required in Django 2.1",
RemovedInDjango21Warning, stacklevel=2
"your code as this parameter will be required in Django 2.0",
RemovedInDjango20Warning, stacklevel=2
)
response = callback(request, **param_dict)
except:
Expand Down
10 changes: 5 additions & 5 deletions django/core/management/base.py
Expand Up @@ -15,7 +15,7 @@
from django.core import checks
from django.core.management.color import color_style, no_style
from django.db import connections
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_str


Expand Down Expand Up @@ -170,7 +170,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
Expand Down Expand Up @@ -263,7 +263,7 @@ def store_as_int(option, opt_str, value, parser):
# 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())
Expand Down Expand Up @@ -578,9 +578,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__()

Expand Down
4 changes: 2 additions & 2 deletions django/core/management/commands/migrate.py
Expand Up @@ -17,7 +17,7 @@
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


Expand Down Expand Up @@ -66,7 +66,7 @@ def handle(self, *args, **options):
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',
Expand Down