#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 BooleanField
s. 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)
Change History (5)
by , 19 years ago
Attachment: | boolean_validator_list.diff added |
---|
comment:1 by , 19 years ago
Summary: | validator_list silently deleted for BooleanFields → [patch] validator_list silently deleted for BooleanFields |
---|
by , 18 years ago
Attachment: | boolean_validator_list2.patch added |
---|
Added mutable default arguments fix
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
allows validator_list for boolean fields