Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1767 closed defect (fixed)

[patch] validator_list silently deleted for BooleanFields

Reported by: jkocherhans Owned by: Adrian Holovaty
Component: Validators Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Line 257 of django/db/models/fields/__init__.py explicitly deletes the validator_list and is_required parameters for BooleanFields. The frustrating part is that no errors are raised by providing a validator_list argument to a BooleanField, and I can't find any doumentation for this behavior. I understand and agree with not allowing is_required, but I have a use case for allowing validator_list. Is there any particular reason it's being deleted? (Other than that it often times simply doesn't have a value... the particular validator should deal with that by checking for a KeyError IMHO) Regardless though, silently deleting the attribute without an error or at least a warning is not very nice ;-)

Attachments (2)

boolean_validator_list.diff (1.6 KB ) - added by jkocherhans 18 years ago.
allows validator_list for boolean fields
boolean_validator_list2.patch (1.6 KB ) - added by Alex Dedul 18 years ago.
Added mutable default arguments fix

Download all attachments as: .zip

Change History (5)

by jkocherhans, 18 years ago

Attachment: boolean_validator_list.diff added

allows validator_list for boolean fields

comment:1 by jkocherhans, 18 years ago

Summary: validator_list silently deleted for BooleanFields[patch] validator_list silently deleted for BooleanFields

comment:2 by James Bennett, 18 years ago

#2314 was a duplicate of this one.

by Alex Dedul, 18 years ago

Added mutable default arguments fix

comment:3 by Jacob, 18 years ago

Resolution: fixed
Status: newclosed

(In [3467]) Fixed #1767 -- boolean fields may now have validators! Thanks, Joseph.

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