浏览代码

Refs #26533 -- Removed support for Widget._format_value() per deprecation timeline.

Tim Graham 8 年之前
父节点
当前提交
58d3d14aea
共有 3 个文件被更改,包括 3 次插入15 次删除
  1. 1 10
      django/forms/widgets.py
  2. 0 5
      docs/ref/forms/widgets.txt
  3. 2 0
      docs/releases/2.0.txt

+ 1 - 10
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

+ 0 - 5
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

+ 2 - 0
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.