diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-09-05 16:10:21 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-09-10 12:01:00 +0200 |
| commit | b47bb4c4a74f926111bdad4a6daae14ceed6f2dd (patch) | |
| tree | 3acf489224640e3a24105ac7f9ee27f7b78e8a82 /django | |
| parent | 416c584cabd62a13985f1569ccf019c8b351f0a5 (diff) | |
Refs #29598 -- Removed FloatRangeField per deprecation timeline.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/postgres/fields/ranges.py | 17 | ||||
| -rw-r--r-- | django/contrib/postgres/forms/ranges.py | 16 |
2 files changed, 1 insertions, 32 deletions
diff --git a/django/contrib/postgres/fields/ranges.py b/django/contrib/postgres/fields/ranges.py index a4fa20adf3..953d02ac65 100644 --- a/django/contrib/postgres/fields/ranges.py +++ b/django/contrib/postgres/fields/ranges.py @@ -11,7 +11,6 @@ from .utils import AttributeSetter __all__ = [ 'RangeField', 'IntegerRangeField', 'BigIntegerRangeField', 'DecimalRangeField', 'DateTimeRangeField', 'DateRangeField', - 'FloatRangeField', 'RangeBoundary', 'RangeOperators', ] @@ -135,22 +134,6 @@ class DecimalRangeField(RangeField): return 'numrange' -class FloatRangeField(RangeField): - system_check_deprecated_details = { - 'msg': ( - 'FloatRangeField is deprecated and will be removed in Django 3.1.' - ), - 'hint': 'Use DecimalRangeField instead.', - 'id': 'fields.W902', - } - base_field = models.FloatField - range_type = NumericRange - form_field = forms.FloatRangeField - - def db_type(self, connection): - return 'numrange' - - class DateTimeRangeField(RangeField): base_field = models.DateTimeField range_type = DateTimeTZRange diff --git a/django/contrib/postgres/forms/ranges.py b/django/contrib/postgres/forms/ranges.py index c36bec8479..47a16a1bbd 100644 --- a/django/contrib/postgres/forms/ranges.py +++ b/django/contrib/postgres/forms/ranges.py @@ -1,16 +1,13 @@ -import warnings - from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget -from django.utils.deprecation import RemovedInDjango31Warning from django.utils.translation import gettext_lazy as _ __all__ = [ 'BaseRangeField', 'IntegerRangeField', 'DecimalRangeField', - 'DateTimeRangeField', 'DateRangeField', 'FloatRangeField', 'RangeWidget', + 'DateTimeRangeField', 'DateRangeField', 'RangeWidget', ] @@ -75,17 +72,6 @@ class DecimalRangeField(BaseRangeField): range_type = NumericRange -class FloatRangeField(DecimalRangeField): - base_field = forms.FloatField - - def __init__(self, **kwargs): - warnings.warn( - 'FloatRangeField is deprecated in favor of DecimalRangeField.', - RemovedInDjango31Warning, stacklevel=2, - ) - super().__init__(**kwargs) - - class DateTimeRangeField(BaseRangeField): default_error_messages = {'invalid': _('Enter two valid date/times.')} base_field = forms.DateTimeField |
