Deprecate IPAddressField in favour of GenericIPAddressField
|Reported by:||Erik Romijn||Owned by:|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||eromijn@…, mike@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Since Django 1.4, we've added
GenericIPAddressField, next to
IPAddressField. The new GenericIPAddressField supports IPv4 as well as IPv6 addresses, and does normalisation of IPv6 addresses. It can also be configured to only accept IPv4 or IPv6 addresses.
As far as I know, IPAddressField has no current features that are not also available in a GenericIPAddressField. Therefore, I suggest that we, some time from now, deprecate IPAddressField, in favour of GenericIPAddressField.
For users, it is database-dependent whether IPAddressFields can just be replaced with GenericIPAddressFields: on PostgreSQL and SQLite, no changes are needed; schema changes are needed on MySQL and Oracle. Examples are listed in the 1.6 release notes https://docs.djangoproject.com/en/dev/releases/1.6/#storage-of-ip-addresses-in-the-comments-app, as we just made the same change for comments.
Change History (12)
comment:7 Changed 4 years ago by
|Component:||Forms → Database layer (models, ORM)|
|Triage Stage:||Someday/Maybe → Accepted|
comment:11 Changed 4 years ago by
|Owner:||set to Aymeric Augustin <aymeric.augustin@…>|
|Status:||new → closed|