Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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 Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Markus Holtermann, 9 years ago

Severity: NormalRelease blocker

comment:3 by Tim Graham, 9 years ago

An idea is to move the deprecation warning of IPAddressField to the system checks framework (and suggest doing the same for third-party fields). It could be a Warning in 1.8 (maybe 1.7 too if we want to resolve the issue about not being able to silence warnings in old migrations) and Error in 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'

comment:4 by Tim Graham, 9 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned

Starting on implementation of my idea to determine feasibility.

comment:5 by Tim Graham, 9 years ago

Has patch: set

comment:6 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 40a85043576f6d163a2a05721a4b2710261fc4f5:

Fixed #23891 -- Moved deprecation of IPAddressField to system check framework.

Thanks Markus Holtermann for review.

comment:8 by Tim Graham, 9 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.

comment:9 by Tim Graham <timograham@…>, 9 years ago

In f60c35cddc33d12a8c9c33ff086521cf3f350fb7:

Removed release note for refs #23891 as the backport proved too difficult.

comment:10 by Tim Graham <timograham@…>, 9 years ago

In 749d23251bbd6564341405e6f8c1da129b8307e7:

Removed warning handling that should have been removed in refs #23891.

Note: See TracTickets for help on using tickets.
Back to Top