Opened 9 years ago

Closed 9 years ago

#26107 closed New feature (fixed)

Add an option to int_list_validator to allow negative integers

Reported by: Brandon Cooper Owned by: Akshesh Doshi
Component: Core (Other) Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The CommaSeparatedIntegerField model-type doesn't allow negative number. https://docs.djangoproject.com/en/1.9/ref/models/fields/#commaseparatedintegerfield

If passing in '-3', it would return a validation error. Seems like this shouldn't be the case.

Change History (7)

comment:1 by Tim Graham, 9 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedSomeday/Maybe
Type: BugNew feature

I see you've sent a PR.

I don't think we can make that change as proposed due to backwards compatibility. Anyone relying on a list of positive values needs a way to keep the old behavior. Alternatively, and probably preferred for backwards compatibility, the new behavior should be opt-in. Make it an option of the validator seems okay, however, instead of also adding that option to CommaSeparatedIntegerField, I've proposed deprecating it.

comment:2 by Brandon Cooper, 9 years ago

sounds good and makes sense. i'll follow along that discussion.

comment:3 by Tim Graham, 9 years ago

Summary: CommaSeparatedIntegerField doesn't allow negative integersAdd an option to int_list_validator to allow negative integers
Triage Stage: Someday/MaybeAccepted

comment:4 by Akshesh Doshi, 9 years ago

Owner: changed from nobody to Akshesh Doshi
Status: newassigned

comment:6 by Tim Graham, 9 years ago

Patch needs improvement: unset

Don't forget to ticket the appropriate flags so the ticket appears in the "Patches needing review" queue.

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

Resolution: fixed
Status: assignedclosed

In d58aaa2:

Fixed #26107 -- Added option to int_list_validator() to allow negative integers.

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