Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#26154 closed Cleanup/optimization (fixed)

Deprecate CommaSeparatedIntegerField

Reported by: Tim Graham Owned by: Tobin Brown
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

As proposed on django-developers, CommaSeparatedIntegerField could be replaced with CharField(validators=[validate_comma_separated_integer_list]).

The only database storage difference is on Oracle:

        'CharField': 'NVARCHAR2(%(max_length)s)',
        'CommaSeparatedIntegerField': 'VARCHAR2(%(max_length)s)',

There are some upgrade considerations described on the mailing list that'll need to be mentioned for Oracle users.

See the migration topic guide for an explanation of how to deprecate the field, as well as the deprecating a feature guide.

Change History (11)

comment:1 by Tobin Brown, 8 years ago

Owner: changed from nobody to Tobin Brown
Status: newassigned

comment:2 by Tobin Brown, 8 years ago

In the docs for deprecating the field it asks me to pick a unique id for the field.

'id': 'fields.W900', # pick a unique ID for your field.

Is there a convention I should follow, or do I just pick a number that doesn't already exist with another field?

comment:3 by Tim Graham, 8 years ago

I'd choose W901 to follow fields.W900: IPAddressField has been deprecated. (reference).

comment:4 by Tobin Brown, 8 years ago

Great! Thanks for the quick response. One more question. In test cases that use CommaSeparatedIntegerField in the model definition (example) would it be better to add the ignore_warnings decorator or change the field to use CharField(validators=[csi_validator])

comment:5 by Tim Graham, 8 years ago

It should use ignore_warnings -- you might use 33457cd3b0da69320d3f66bb6d5a673950c5032f as a rough template to see what changes were made last time we did this (of course that's at the end of the deprecation period).

comment:6 by Tobin Brown, 8 years ago

Do I use RemovedInDjango20Warning? I thought the next version was going to be 1.10

comment:7 by Tim Graham, 8 years ago

Features go through a two release deprecation cycle.

comment:8 by Tobin Brown, 8 years ago

Ah, gotcha. Just read the roadmap and it makes sense now

comment:9 by Tim Graham, 8 years ago

Has patch: set
Patch needs improvement: set

Left comments for improvement on the PR.

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

Resolution: fixed
Status: assignedclosed

In dca8b916:

Fixed #26154 -- Deprecated CommaSeparatedIntegerField

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

In bcf3532:

Refs #26154 -- Removed deprecated CommaSeparatedIntegerField.

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