Refs #16508 -- Removed virtual aliases of "private fields".

Per deprecation timeline.
This commit is contained in:
Tim Graham 2016-12-31 11:54:49 -05:00
parent eba093e8b0
commit 933dc62742
3 changed files with 7 additions and 27 deletions

View file

@ -19,15 +19,12 @@ from django.utils import six
from django.utils.datastructures import ImmutableList, OrderedSet
from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedInDjango21Warning,
warn_about_renamed_method,
)
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.functional import cached_property
from django.utils.text import camel_case_to_spaces, format_lazy
from django.utils.translation import override
NOT_PROVIDED = object()
PROXY_PARENTS = object()
EMPTY_RELATION_TREE = tuple()
@ -259,13 +256,7 @@ class Options(object):
self.local_managers.append(manager)
self._expire_cache()
def add_field(self, field, private=False, virtual=NOT_PROVIDED):
if virtual is not NOT_PROVIDED:
warnings.warn(
"The `virtual` argument of Options.add_field() has been renamed to `private`.",
RemovedInDjango20Warning, stacklevel=2
)
private = virtual
def add_field(self, field, private=False):
# Insert the given field in the order in which it was created, using
# the "creation_counter" attribute of the field.
# Move many-to-many related fields from self.fields into
@ -516,14 +507,6 @@ class Options(object):
"concrete_fields", (f for f in self.fields if f.concrete)
)
@property
@warn_about_renamed_method(
'Options', 'virtual_fields', 'private_fields',
RemovedInDjango20Warning
)
def virtual_fields(self):
return self.private_fields
@cached_property
def local_concrete_fields(self):
"""