Removed Field.rel and Field.remote_field.to per deprecation timeline.
This commit is contained in:
parent
0f454f5d4d
commit
625e9da9ca
|
@ -251,13 +251,6 @@ class Field(RegisterLookupMixin):
|
||||||
else:
|
else:
|
||||||
return []
|
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):
|
def _check_choices(self):
|
||||||
if self.choices:
|
if self.choices:
|
||||||
if (isinstance(self.choices, six.string_types) or
|
if (isinstance(self.choices, six.string_types) or
|
||||||
|
|
|
@ -11,10 +11,7 @@ they're the closest concept currently available.
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
from django.core import exceptions
|
from django.core import exceptions
|
||||||
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
|
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
|
# __init__ as the field doesn't have its model yet. Calling these methods
|
||||||
# before field.contribute_to_class() has been called will result in
|
# before field.contribute_to_class() has been called will result in
|
||||||
# AttributeError
|
# 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
|
@cached_property
|
||||||
def hidden(self):
|
def hidden(self):
|
||||||
return self.is_hidden()
|
return self.is_hidden()
|
||||||
|
|
|
@ -247,3 +247,5 @@ these features.
|
||||||
* The ``host`` argument to ``SimpleTestCase.assertsRedirects()`` is removed.
|
* The ``host`` argument to ``SimpleTestCase.assertsRedirects()`` is removed.
|
||||||
The compatibility layer which allows absolute URLs to be considered equal to
|
The compatibility layer which allows absolute URLs to be considered equal to
|
||||||
relative ones when the path is identical is also removed.
|
relative ones when the path is identical is also removed.
|
||||||
|
|
||||||
|
* ``Field.rel`` and ``Field.remote_field.to`` are removed.
|
||||||
|
|
Loading…
Reference in New Issue