Refs #24716 -- Removed Field._get_val_from_obj() per deprecation timeline.
This commit is contained in:
parent
ad393beeb7
commit
733c7c7030
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue