Refs #24716 -- Removed Field._get_val_from_obj() per deprecation timeline.

This commit is contained in:
Tim Graham 2016-12-31 07:36:21 -05:00
parent ad393beeb7
commit 733c7c7030
2 changed files with 3 additions and 13 deletions

View File

@ -27,9 +27,7 @@ from django.utils.datastructures import DictWrapper
from django.utils.dateparse import (
parse_date, parse_datetime, parse_duration, parse_time,
)
from django.utils.deprecation import (
RemovedInDjango20Warning, warn_about_renamed_method,
)
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.duration import duration_string
from django.utils.encoding import (
force_bytes, force_text, python_2_unicode_compatible, smart_text,
@ -810,16 +808,6 @@ class Field(RegisterLookupMixin):
limit_choices_to)]
return first_choice + lst
@warn_about_renamed_method(
'Field', '_get_val_from_obj', 'value_from_object',
RemovedInDjango20Warning
)
def _get_val_from_obj(self, obj):
if obj is not None:
return getattr(obj, self.attname)
else:
return self.get_default()
def value_to_string(self, obj):
"""
Returns a string value of this field from the passed obj.

View File

@ -299,3 +299,5 @@ these features.
* Support for setting a URL instance namespace without an application namespace
is removed.
* ``Field._get_val_from_obj()`` is removed.