#23891 closed Cleanup/optimization (fixed)
Revise deprecation / removal timeline for IPAddressField
| Reported by: | Markus Holtermann | Owned by: | Tim Graham |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Release blocker | Keywords: | |
| Cc: | Markus Holtermann | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
As initially mentioned in #23861, the IPAddressField will be removed in 1.9. Given the current way of squashing migration files, this probably becomes painful to migrate. A proposal that came up in the linked ticket is to keep a stub field around for a bit longer (maybe 2.0?) that works (as a noop) in migrations (prevents import errors) but throws errors if used outside migrations.
Change History (10)
comment:1 by , 11 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 11 years ago
| Severity: | Normal → Release blocker |
|---|
comment:3 by , 11 years ago
comment:4 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Starting on implementation of my idea to determine feasibility.
comment:6 by , 11 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:7 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:8 by , 11 years ago
Actually, it seems rather difficult to backport this to 1.7 and keep the test suite output free of these warnings because call_command() executes system checks (changed in master in 685edab9da89b54e3e0e7bbc1c9f8b33d3f45969). Since PendingDeprecatingWarning is silent by default, I think we should just live with the status quo there. However, if someone wants to attempt the backport, I'll happily commit it.
An idea is to move the deprecation warning of
IPAddressFieldto the system checks framework (and suggest doing the same for third-party fields). It could be aWarningin 1.8 (maybe 1.7 too if we want to resolve the issue about not being able to silence warnings in old migrations) andErrorin 1.9. I can investigate this approach a bit more if the feedback is positive.Here is a stub that could be kept around in 1.9 (and longer if necessary) to allow people to migrate away from it.
class IPAddressField(Field): def __init__(self, *args, **kwargs): kwargs['max_length'] = 15 super(IPAddressField, self).__init__(*args, **kwargs) def deconstruct(self): name, path, args, kwargs = super(IPAddressField, self).deconstruct() del kwargs['max_length'] return name, path, args, kwargs def get_internal_type(self): return 'IPAddressField'