Refs #24215 -- Removed add_lazy_relation() per deprecation timeline.

This commit is contained in:
Tim Graham 2016-12-30 17:55:03 -05:00
parent ddd3268975
commit b2ffbb00a5
2 changed files with 2 additions and 15 deletions

View File

@ -1,7 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import inspect import inspect
import warnings
from functools import partial from functools import partial
from django import forms from django import forms
@ -15,7 +14,6 @@ from django.db.models.deletion import CASCADE, SET_DEFAULT, SET_NULL
from django.db.models.query_utils import PathInfo from django.db.models.query_utils import PathInfo
from django.db.models.utils import make_model_tuple from django.db.models.utils import make_model_tuple
from django.utils import six from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.functional import cached_property, curry from django.utils.functional import cached_property, curry
from django.utils.lru_cache import lru_cache from django.utils.lru_cache import lru_cache
@ -84,19 +82,6 @@ def lazy_related_operation(function, model, *related_models, **kwargs):
return apps.lazy_model_operation(partial(function, **kwargs), *model_keys) return apps.lazy_model_operation(partial(function, **kwargs), *model_keys)
def add_lazy_relation(cls, field, relation, operation):
warnings.warn(
"add_lazy_relation() has been superseded by lazy_related_operation() "
"and related methods on the Apps class.",
RemovedInDjango20Warning, stacklevel=2)
# Rearrange args for new Apps.lazy_model_operation
def function(local, related, field):
return operation(field, related, local)
lazy_related_operation(function, cls, relation, field=field)
class RelatedField(Field): class RelatedField(Field):
""" """
Base class that all relational fields inherit from. Base class that all relational fields inherit from.

View File

@ -252,3 +252,5 @@ these features.
* The ``on_delete`` argument for ``ForeignKey`` and ``OneToOneField`` are now * The ``on_delete`` argument for ``ForeignKey`` and ``OneToOneField`` are now
required. required.
* ``django.db.models.fields.add_lazy_relation()`` is removed.