From 733c7c703030d2546b729dfa20edfa5217d1da20 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 31 Dec 2016 07:36:21 -0500 Subject: [PATCH] Refs #24716 -- Removed Field._get_val_from_obj() per deprecation timeline. --- django/db/models/fields/__init__.py | 14 +------------- docs/releases/2.0.txt | 2 ++ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 63a2fc8fa41..f5d6734aab4 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -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. diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index 0ae25a82952..42d6c5b5406 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -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.