Django

Code

Ticket #1767 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

[patch] validator_list silently deleted for BooleanFields

Reported by: jkocherhans Assigned to: adrian
Milestone: Component: Validators
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

boolean_validator_list.diff (1.6 kB) - added by jkocherhans on 05/04/06 16:15:49.
allows validator_list for boolean fields
boolean_validator_list2.patch (1.6 kB) - added by Alex Dedul on 07/24/06 07:30:39.
Added mutable default arguments fix

Change History

05/04/06 16:15:49 changed by jkocherhans

  • attachment boolean_validator_list.diff added.

allows validator_list for boolean fields

05/04/06 16:16:17 changed by jkocherhans

  • summary changed from validator_list silently deleted for BooleanFields to [patch] validator_list silently deleted for BooleanFields.

07/24/06 06:10:28 changed by ubernostrum

#2314 was a duplicate of this one.

07/24/06 07:30:39 changed by Alex Dedul

  • attachment boolean_validator_list2.patch added.

Added mutable default arguments fix

07/27/06 19:13:11 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #1767 ([patch] validator_list silently deleted for BooleanFields)




Change Properties
Action