From 625e9da9cac76ad6e7045d61b57834cc0c2d94d9 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 16 Dec 2016 18:19:52 -0500 Subject: [PATCH] Removed Field.rel and Field.remote_field.to per deprecation timeline. --- django/db/models/fields/__init__.py | 7 ------- django/db/models/fields/reverse_related.py | 11 ----------- docs/releases/2.0.txt | 2 ++ 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index b7d60f9921..63a2fc8fa4 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -251,13 +251,6 @@ class Field(RegisterLookupMixin): else: return [] - @property - def rel(self): - warnings.warn( - "Usage of field.rel has been deprecated. Use field.remote_field instead.", - RemovedInDjango20Warning, 2) - return self.remote_field - def _check_choices(self): if self.choices: if (isinstance(self.choices, six.string_types) or diff --git a/django/db/models/fields/reverse_related.py b/django/db/models/fields/reverse_related.py index 86e96ee133..82d9af64e7 100644 --- a/django/db/models/fields/reverse_related.py +++ b/django/db/models/fields/reverse_related.py @@ -11,10 +11,7 @@ they're the closest concept currently available. from __future__ import unicode_literals -import warnings - from django.core import exceptions -from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_text from django.utils.functional import cached_property @@ -56,14 +53,6 @@ class ForeignObjectRel(object): # __init__ as the field doesn't have its model yet. Calling these methods # before field.contribute_to_class() has been called will result in # AttributeError - @property - def to(self): - warnings.warn( - "Usage of ForeignObjectRel.to attribute has been deprecated. " - "Use the model attribute instead.", - RemovedInDjango20Warning, 2) - return self.model - @cached_property def hidden(self): return self.is_hidden() diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index 984e13e9f1..6fd8c906ef 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -247,3 +247,5 @@ these features. * The ``host`` argument to ``SimpleTestCase.assertsRedirects()`` is removed. The compatibility layer which allows absolute URLs to be considered equal to relative ones when the path is identical is also removed. + +* ``Field.rel`` and ``Field.remote_field.to`` are removed.