Loading django/db/models/fields/__init__.py +4 −9 Original line number Diff line number Diff line Loading @@ -1894,13 +1894,13 @@ class BigIntegerField(IntegerField): class IPAddressField(Field): empty_strings_allowed = False description = _("IPv4 address") system_check_deprecated_details = { system_check_removed_details = { 'msg': ( 'IPAddressField has been deprecated. Support for it (except in ' 'historical migrations) will be removed in Django 1.9.' 'IPAddressField has been removed except for support in ' 'historical migrations.' ), 'hint': 'Use GenericIPAddressField instead.', 'id': 'fields.W900', 'id': 'fields.E900', } def __init__(self, *args, **kwargs): Loading @@ -1921,11 +1921,6 @@ class IPAddressField(Field): def get_internal_type(self): return "IPAddressField" def formfield(self, **kwargs): defaults = {'form_class': forms.IPAddressField} defaults.update(kwargs) return super(IPAddressField, self).formfield(**defaults) class GenericIPAddressField(Field): empty_strings_allowed = False Loading django/forms/fields.py +2 −16 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ from django.utils import formats from django.utils.encoding import smart_text, force_str, force_text from django.utils.ipv6 import clean_ipv6_address from django.utils.dateparse import parse_duration from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning, RenameMethodsBase from django.utils.deprecation import RemovedInDjango20Warning, RenameMethodsBase from django.utils.duration import duration_string from django.utils import six from django.utils.six.moves.urllib.parse import urlsplit, urlunsplit Loading @@ -43,7 +43,7 @@ __all__ = ( 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField', 'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField', 'ComboField', 'MultiValueField', 'FloatField', 'DecimalField', 'SplitDateTimeField', 'IPAddressField', 'GenericIPAddressField', 'FilePathField', 'SplitDateTimeField', 'GenericIPAddressField', 'FilePathField', 'SlugField', 'TypedChoiceField', 'TypedMultipleChoiceField', 'UUIDField', ) Loading Loading @@ -1206,20 +1206,6 @@ class SplitDateTimeField(MultiValueField): return None class IPAddressField(CharField): default_validators = [validators.validate_ipv4_address] def __init__(self, *args, **kwargs): warnings.warn("IPAddressField has been deprecated. Use GenericIPAddressField instead.", RemovedInDjango19Warning) super(IPAddressField, self).__init__(*args, **kwargs) def to_python(self, value): if value in self.empty_values: return '' return value.strip() class GenericIPAddressField(CharField): def __init__(self, protocol='both', unpack_ipv4=False, *args, **kwargs): self.unpack_ipv4 = unpack_ipv4 Loading docs/ref/checks.txt +4 −1 Original line number Diff line number Diff line Loading @@ -95,8 +95,11 @@ Fields * **fields.E160**: The options ``auto_now``, ``auto_now_add``, and ``default`` are mutually exclusive. Only one of these options may be present. * **fields.W161**: Fixed default value provided. * **fields.E900**: ``IPAddressField`` has been removed except for support in historical migrations. * **fields.W900**: ``IPAddressField`` has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9. (except in historical migrations) will be removed in Django 1.9. *This check appeared in Django 1.7 and 1.8*. File Fields ~~~~~~~~~~~ Loading docs/ref/forms/fields.txt +0 −16 Original line number Diff line number Diff line Loading @@ -719,22 +719,6 @@ For each field, we describe the default widget used if you don't specify These control the range of values permitted in the field. ``IPAddressField`` ~~~~~~~~~~~~~~~~~~ .. class:: IPAddressField(**kwargs) .. deprecated:: 1.7 This field has been deprecated in favor of :class:`~django.forms.GenericIPAddressField`. * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid IPv4 address, using a regular expression. * Error message keys: ``required``, ``invalid`` ``GenericIPAddressField`` ~~~~~~~~~~~~~~~~~~~~~~~~~ Loading docs/ref/models/fields.txt +0 −12 Original line number Diff line number Diff line Loading @@ -892,18 +892,6 @@ An integer. Values from ``-2147483648`` to ``2147483647`` are safe in all databases supported by Django. The default form widget for this field is a :class:`~django.forms.TextInput`. ``IPAddressField`` ------------------ .. class:: IPAddressField([**options]) .. deprecated:: 1.7 This field has been deprecated in favor of :class:`~django.db.models.GenericIPAddressField`. An IP address, in string format (e.g. "192.0.2.30"). The default form widget for this field is a :class:`~django.forms.TextInput`. ``GenericIPAddressField`` ------------------------- Loading Loading
django/db/models/fields/__init__.py +4 −9 Original line number Diff line number Diff line Loading @@ -1894,13 +1894,13 @@ class BigIntegerField(IntegerField): class IPAddressField(Field): empty_strings_allowed = False description = _("IPv4 address") system_check_deprecated_details = { system_check_removed_details = { 'msg': ( 'IPAddressField has been deprecated. Support for it (except in ' 'historical migrations) will be removed in Django 1.9.' 'IPAddressField has been removed except for support in ' 'historical migrations.' ), 'hint': 'Use GenericIPAddressField instead.', 'id': 'fields.W900', 'id': 'fields.E900', } def __init__(self, *args, **kwargs): Loading @@ -1921,11 +1921,6 @@ class IPAddressField(Field): def get_internal_type(self): return "IPAddressField" def formfield(self, **kwargs): defaults = {'form_class': forms.IPAddressField} defaults.update(kwargs) return super(IPAddressField, self).formfield(**defaults) class GenericIPAddressField(Field): empty_strings_allowed = False Loading
django/forms/fields.py +2 −16 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ from django.utils import formats from django.utils.encoding import smart_text, force_str, force_text from django.utils.ipv6 import clean_ipv6_address from django.utils.dateparse import parse_duration from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning, RenameMethodsBase from django.utils.deprecation import RemovedInDjango20Warning, RenameMethodsBase from django.utils.duration import duration_string from django.utils import six from django.utils.six.moves.urllib.parse import urlsplit, urlunsplit Loading @@ -43,7 +43,7 @@ __all__ = ( 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField', 'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField', 'ComboField', 'MultiValueField', 'FloatField', 'DecimalField', 'SplitDateTimeField', 'IPAddressField', 'GenericIPAddressField', 'FilePathField', 'SplitDateTimeField', 'GenericIPAddressField', 'FilePathField', 'SlugField', 'TypedChoiceField', 'TypedMultipleChoiceField', 'UUIDField', ) Loading Loading @@ -1206,20 +1206,6 @@ class SplitDateTimeField(MultiValueField): return None class IPAddressField(CharField): default_validators = [validators.validate_ipv4_address] def __init__(self, *args, **kwargs): warnings.warn("IPAddressField has been deprecated. Use GenericIPAddressField instead.", RemovedInDjango19Warning) super(IPAddressField, self).__init__(*args, **kwargs) def to_python(self, value): if value in self.empty_values: return '' return value.strip() class GenericIPAddressField(CharField): def __init__(self, protocol='both', unpack_ipv4=False, *args, **kwargs): self.unpack_ipv4 = unpack_ipv4 Loading
docs/ref/checks.txt +4 −1 Original line number Diff line number Diff line Loading @@ -95,8 +95,11 @@ Fields * **fields.E160**: The options ``auto_now``, ``auto_now_add``, and ``default`` are mutually exclusive. Only one of these options may be present. * **fields.W161**: Fixed default value provided. * **fields.E900**: ``IPAddressField`` has been removed except for support in historical migrations. * **fields.W900**: ``IPAddressField`` has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9. (except in historical migrations) will be removed in Django 1.9. *This check appeared in Django 1.7 and 1.8*. File Fields ~~~~~~~~~~~ Loading
docs/ref/forms/fields.txt +0 −16 Original line number Diff line number Diff line Loading @@ -719,22 +719,6 @@ For each field, we describe the default widget used if you don't specify These control the range of values permitted in the field. ``IPAddressField`` ~~~~~~~~~~~~~~~~~~ .. class:: IPAddressField(**kwargs) .. deprecated:: 1.7 This field has been deprecated in favor of :class:`~django.forms.GenericIPAddressField`. * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid IPv4 address, using a regular expression. * Error message keys: ``required``, ``invalid`` ``GenericIPAddressField`` ~~~~~~~~~~~~~~~~~~~~~~~~~ Loading
docs/ref/models/fields.txt +0 −12 Original line number Diff line number Diff line Loading @@ -892,18 +892,6 @@ An integer. Values from ``-2147483648`` to ``2147483647`` are safe in all databases supported by Django. The default form widget for this field is a :class:`~django.forms.TextInput`. ``IPAddressField`` ------------------ .. class:: IPAddressField([**options]) .. deprecated:: 1.7 This field has been deprecated in favor of :class:`~django.db.models.GenericIPAddressField`. An IP address, in string format (e.g. "192.0.2.30"). The default form widget for this field is a :class:`~django.forms.TextInput`. ``GenericIPAddressField`` ------------------------- Loading