From e1b93dbbef6afb86cf17be7f260f7b05ab7579e2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 17 Jan 2015 14:57:34 -0500 Subject: [PATCH] Removed deprecated aliases in django.db.models. --- django/db/models/__init__.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/django/db/models/__init__.py b/django/db/models/__init__.py index 9348529625..3bdd0b330b 100644 --- a/django/db/models/__init__.py +++ b/django/db/models/__init__.py @@ -1,6 +1,4 @@ from functools import wraps -import sys -import warnings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured # NOQA from django.db.models.query import Q, QuerySet, Prefetch # NOQA @@ -19,7 +17,6 @@ from django.db.models.deletion import ( # NOQA CASCADE, PROTECT, SET, SET_NULL, SET_DEFAULT, DO_NOTHING, ProtectedError) from django.db.models.lookups import Lookup, Transform # NOQA from django.db.models import signals # NOQA -from django.utils.deprecation import RemovedInDjango19Warning def permalink(func): @@ -39,26 +36,3 @@ def permalink(func): bits = func(*args, **kwargs) return reverse(bits[0], None, *bits[1:3]) return inner - - -# Deprecated aliases for functions were exposed in this module. - -def make_alias(function_name): - # Close function_name. - def alias(*args, **kwargs): - warnings.warn( - "django.db.models.%s is deprecated." % function_name, - RemovedInDjango19Warning, stacklevel=2) - # This raises a second warning. - from . import loading - return getattr(loading, function_name)(*args, **kwargs) - alias.__name__ = function_name - return alias - -this_module = sys.modules['django.db.models'] - -for function_name in ('get_apps', 'get_app_path', 'get_app_paths', 'get_app', - 'get_models', 'get_model', 'register_models'): - setattr(this_module, function_name, make_alias(function_name)) - -del this_module, make_alias, function_name