From 58d3d14aeaf17a27c0fa663173dbf8dd92053923 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 31 Dec 2016 12:34:00 -0500 Subject: [PATCH] Refs #26533 -- Removed support for Widget._format_value() per deprecation timeline. --- django/forms/widgets.py | 11 +---------- docs/ref/forms/widgets.txt | 5 ----- docs/releases/2.0.txt | 2 ++ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/django/forms/widgets.py b/django/forms/widgets.py index a2f674fcdd..71f408e783 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -15,9 +15,6 @@ from django.forms.utils import to_current_timezone from django.templatetags.static import static from django.utils import datetime_safe, formats, six from django.utils.dates import MONTHS -from django.utils.deprecation import ( - RemovedInDjango20Warning, RenameMethodsBase, -) from django.utils.encoding import ( force_str, force_text, python_2_unicode_compatible, ) @@ -160,13 +157,7 @@ class MediaDefiningClass(type): return new_class -class RenameWidgetMethods(MediaDefiningClass, RenameMethodsBase): - renamed_methods = ( - ('_format_value', 'format_value', RemovedInDjango20Warning), - ) - - -class Widget(six.with_metaclass(RenameWidgetMethods)): +class Widget(six.with_metaclass(MediaDefiningClass)): needs_multipart_form = False # Determines does this widget need multipart form is_localized = False is_required = False diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index f0301c1eee..2b9cf489f1 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -236,11 +236,6 @@ foundation for custom widgets. isn't guaranteed to be valid input, therefore subclass implementations should program defensively. - .. versionchanged:: 1.10 - - In older versions, this method is a private API named - ``_format_value()``. The old name will work until Django 2.0. - .. method:: get_context(name, value, attrs=None) .. versionadded:: 1.11 diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index c8aaab3e71..19ae47fc49 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -373,3 +373,5 @@ these features. * In multi-table inheritance, implicit promotion of a ``OneToOneField`` to a ``parent_link`` is removed. + +* Support for ``Widget._format_value()`` is removed.